library(coin)
library(ggplot2)
library(scales)
library(dplyr)
library(ebal)
library(survey)
library(psych)
library(list)
library(stm)
library(tm)
library(quanteda)
library(tidyr)
library(tidytext)
library(textdata)


#####Load TESS.csv and Save as "TESS"#####


#####Recode Variables (see Codebook for definitions)#####

###Create Aggregate Hostile Sexism Measure###
rescale <- function(x){
  return((x-min(x,na.rm=TRUE))/(max(x-min(x,na.rm=TRUE),na.rm=TRUE)))
}

TESS$HostileSexism <- (TESS$HostileSexism1 + TESS$HostileSexism2 + TESS$HostileSexism3 + TESS$HostileSexism4) / 4

TESS$HostileSexism <- rescale(TESS$HostileSexism)

#Calculate Cronbach's Alpha (Note: Equals 0.78, which indicates good reliability. Cannot improve if drop any component variable)#
HostileSexism <- TESS
HostileSexism <- subset(HostileSexism, select=c(HostileSexism1, HostileSexism2, HostileSexism3, HostileSexism4))
psych::alpha(HostileSexism)


###Create Aggregate Benevolent Sexism Measure###
TESS$BenevolentSexism <- (TESS$BenevolentSexism1 + TESS$BenevolentSexism2 + TESS$BenevolentSexism3 + TESS$BenevolentSexism4) / 4

TESS$BenevolentSexism <- rescale(TESS$BenevolentSexism)

#Calculate Cronbach's Alpha (Note: Equals 0.47, which indicates mediocre reliability. Cannot improve if drop any component variable)#
BenevolentSexism <- TESS
BenevolentSexism <- subset(BenevolentSexism, select=c(BenevolentSexism1, BenevolentSexism2, BenevolentSexism3, BenevolentSexism4))
psych::alpha(BenevolentSexism)


### Create Militant Assertiveness Measure###
TESS$MilAssert <- (TESS$MilAssert1 + TESS$MilAssert2 + TESS$MilAssert3) / 3

TESS$MilAssert <- rescale(TESS$MilAssert)

#Calculate Cronbach's Alpha (Note: Equals 0.70, which indicates good reliability. Cannot improve if drop any component variable)#
MilAssert <- TESS
MilAssert <- subset(MilAssert, select=c(MilAssert1, MilAssert2, MilAssert3))
psych::alpha(MilAssert)


###PartyID IQR###
quantile(TESS$PartyID, c(0.25, 0.75), na.rm=TRUE)

TESS$PartyIDIQR <- NA
TESS$PartyIDIQR[TESS$PartyID<=2] <- 0
TESS$PartyIDIQR[TESS$PartyID>=6] <- 1


###Age IQR###
quantile(TESS$Age7, c(0.25, 0.75), na.rm=TRUE)

TESS$AgeIQR <- NA
TESS$AgeIQR[TESS$Age7<=2] <- 0
TESS$AgeIQR[TESS$Age7>=5] <- 1


###Education IQR###
quantile(TESS$Education6, c(0.25, 0.75), na.rm=TRUE)

TESS$EducationIQR <- NA
TESS$EducationIQR[TESS$Education6<=3] <- 0
TESS$EducationIQR[TESS$Education6>=5] <- 1


###Hostile Sexism IQR###
quantile(TESS$HostileSexism, c(0.25, 0.75), na.rm=TRUE)

TESS$HostileSexismIQR <- NA
TESS$HostileSexismIQR[TESS$HostileSexism<=.15] <- 0
TESS$HostileSexismIQR[TESS$HostileSexism>=.50] <- 1


###Benevolent Sexism IQR###
quantile(TESS$BenevolentSexism, c(0.25, 0.75), na.rm=TRUE)

TESS$BenevolentSexismIQR <- NA
TESS$BenevolentSexismIQR[TESS$BenevolentSexism<=.45] <- 0
TESS$BenevolentSexismIQR[TESS$BenevolentSexism>=.70] <- 1


###Militant Assertiveness IQR###
quantile(TESS$MilAssert, c(0.25, 0.75), na.rm=TRUE)

TESS$MilAssertIQR <- NA
TESS$MilAssertIQR[TESS$MilAssert<=.333] <- 0
TESS$MilAssertIQR[TESS$MilAssert>=.666] <- 1


#####Create dataset without those who got more than one attention check question wrong####
TESS2 <- subset(TESS, AttentionCheck>=2) 



#####Table 3#####

###Bootstrapped Difference in Means###
RNGkind(sample.kind="Rounding")
set.seed(43215)
B <- 2000 

bootTreat2 <- function(dat, label="Treatment"){
  bootResults <- matrix(NA, nrow=B, ncol=24)
  for (i in seq_len(B)){
    resample <- sample(1:nrow(dat),nrow(dat),replace=T)
    temp <- dat[resample,]
    A <- mean(temp$DisapprovalBinary[which(temp$StayOut==1)], na.rm=TRUE)
    B <- mean(temp$DisapprovalBinary[which(temp$NotEngage==1)], na.rm=TRUE)
    C <- mean(temp$DisapprovalBinary[which(temp$Engage==1)], na.rm=TRUE)
    D <- mean(temp$DisapprovalBinary[which(temp$StayOut==1 & temp$FemaleUS==0 & temp$FemaleOpp==0)], na.rm=TRUE)
    E <- mean(temp$DisapprovalBinary[which(temp$NotEngage==1 & temp$FemaleUS==0 & temp$FemaleOpp==0)], na.rm=TRUE)
    G <- mean(temp$DisapprovalBinary[which(temp$Engage==1 & temp$FemaleUS==0 & temp$FemaleOpp==0)], na.rm=TRUE)
    H <- mean(temp$DisapprovalBinary[which(temp$StayOut==1 & temp$FemaleUS==0 & temp$FemaleOpp==1)], na.rm=TRUE)
    I <- mean(temp$DisapprovalBinary[which(temp$NotEngage==1 & temp$FemaleUS==0 & temp$FemaleOpp==1)], na.rm=TRUE)
    J <- mean(temp$DisapprovalBinary[which(temp$Engage==1 & temp$FemaleUS==0 & temp$FemaleOpp==1)], na.rm=TRUE)   
    K <- mean(temp$DisapprovalBinary[which(temp$StayOut==1 & temp$FemaleUS==1 & temp$FemaleOpp==1)], na.rm=TRUE)
    L <- mean(temp$DisapprovalBinary[which(temp$NotEngage==1 & temp$FemaleUS==1 & temp$FemaleOpp==1)], na.rm=TRUE)
    M <- mean(temp$DisapprovalBinary[which(temp$Engage==1 & temp$FemaleUS==1 & temp$FemaleOpp==1)], na.rm=TRUE)      
    N <- mean(temp$DisapprovalBinary[which(temp$StayOut==1 & temp$FemaleUS==1 & temp$FemaleOpp==0)], na.rm=TRUE)
    O <- mean(temp$DisapprovalBinary[which(temp$NotEngage==1 & temp$FemaleUS==1 & temp$FemaleOpp==0)], na.rm=TRUE)
    P <- mean(temp$DisapprovalBinary[which(temp$Engage==1 & temp$FemaleUS==1 & temp$FemaleOpp==0)], na.rm=TRUE)     
    bootResults[i,1] <- (B-A)
    bootResults[i,2] <- (C-A)
    bootResults[i,3] <- (B-C)  
    bootResults[i,4] <- (E-D)
    bootResults[i,5] <- (G-D)
    bootResults[i,6] <- (E-G)  
    bootResults[i,7] <- (I-H)
    bootResults[i,8] <- (J-H)
    bootResults[i,9] <- (I-J)  
    bootResults[i,10] <- (L-K)
    bootResults[i,11] <- (M-K)
    bootResults[i,12] <- (L-M)  
    bootResults[i,13] <- (O-N)
    bootResults[i,14] <- (P-N)
    bootResults[i,15] <- (O-P)  
    bootResults[i,16] <- (I-H) - (E-D) 
    bootResults[i,17] <- (J-H) - (G-D) 
    bootResults[i,18] <- (I-J) - (E-G) 
    bootResults[i,19] <- (L-K) - (E-D) 
    bootResults[i,20] <- (M-K) - (G-D) 
    bootResults[i,21] <- (L-M) - (E-G) 
    bootResults[i,22] <- (O-N) - (E-D) 
    bootResults[i,23] <- (P-N) - (G-D) 
    bootResults[i,24] <- (O-P) - (E-G) 
    drop(list())
  }
  return(list(model=label, boot=bootResults, AC.Full=mean(bootResults[,1], na.rm=TRUE), 
              BC.Full=mean(bootResults[,2], na.rm=TRUE), IC.Full=mean(bootResults[,3], na.rm=TRUE), 
              AC.MM=mean(bootResults[,4], na.rm=TRUE), BC.MM=mean(bootResults[,5], na.rm=TRUE), 
              IC.MM=mean(bootResults[,6], na.rm=TRUE), AC.MF=mean(bootResults[,7], na.rm=TRUE), 
              BC.MF=mean(bootResults[,8], na.rm=TRUE), IC.MF=mean(bootResults[,9], na.rm=TRUE),
              AC.FF=mean(bootResults[,10], na.rm=TRUE), BC.FF=mean(bootResults[,11], na.rm=TRUE), 
              IC.FF=mean(bootResults[,12], na.rm=TRUE), AC.FM=mean(bootResults[,13], na.rm=TRUE), 
              BC.FM=mean(bootResults[,14], na.rm=TRUE), IC.FM=mean(bootResults[,15], na.rm=TRUE),
              AC.MFControl=mean(bootResults[,16], na.rm=TRUE), BC.MFControl=mean(bootResults[,17], na.rm=TRUE),
              IC.MFControl=mean(bootResults[,18], na.rm=TRUE), AC.FFControl=mean(bootResults[,19], na.rm=TRUE),
              BC.FFControl=mean(bootResults[,20], na.rm=TRUE), IC.FFControl=mean(bootResults[,21], na.rm=TRUE),
              AC.FMControl=mean(bootResults[,22], na.rm=TRUE), BC.FMControl=mean(bootResults[,23], na.rm=TRUE),
              IC.FMControl=mean(bootResults[,24], na.rm=TRUE)))
}

full.2 <- bootTreat2(TESS2)

##FM Audience Costs Relative to the MM Control##
round(c(full.2$AC.FMControl, quantile(full.2$boot[,22], c(0.025, 0.975))), digits=3)
#FM Audience Costs#
round(c(full.2$AC.FM, quantile(full.2$boot[,13], c(0.025, 0.975))), digits=3)
#MM Audience Costs#
round(c(full.2$AC.MM, quantile(full.2$boot[,4], c(0.025, 0.975))), digits=3)

##FF Audience Costs Relative to the MM Control##
round(c(full.2$AC.FFControl, quantile(full.2$boot[,19], c(0.025, 0.975))), digits=3)
#FF Audience Costs#
round(c(full.2$AC.FF, quantile(full.2$boot[,10], c(0.025, 0.975))), digits=3)
#MM Audience Costs#
round(c(full.2$AC.MM, quantile(full.2$boot[,4], c(0.025, 0.975))), digits=3)

##MF Audience Costs Relative to the MM Control##
round(c(full.2$AC.MFControl, quantile(full.2$boot[,16], c(0.025, 0.975))), digits=3)
#MF Audience Costs#
round(c(full.2$AC.MF, quantile(full.2$boot[,7], c(0.025, 0.975))), digits=3)
#MM Audience Costs#
round(c(full.2$AC.MM, quantile(full.2$boot[,4], c(0.025, 0.975))), digits=3)

##FM Inconsistency Costs Relative to the MM Control##
round(c(full.2$IC.FMControl, quantile(full.2$boot[,24], c(0.025, 0.975))), digits=3)
#FM Inconsistency Costs#
round(c(full.2$IC.FM, quantile(full.2$boot[,15], c(0.025, 0.975))), digits=3)
#MM Inconsistency Costs#
round(c(full.2$IC.MM, quantile(full.2$boot[,6], c(0.025, 0.975))), digits=3)

##FF Inconsistency Costs Relative to the MM Control##
round(c(full.2$IC.FFControl, quantile(full.2$boot[,21], c(0.025, 0.975))), digits=3)
#FF Inconsistency Costs#
round(c(full.2$IC.FF, quantile(full.2$boot[,12], c(0.025, 0.975))), digits=3)
#MM Inconsistency Costs#
round(c(full.2$IC.MM, quantile(full.2$boot[,6], c(0.025, 0.975))), digits=3)

##MF Inconsistency Costs Relative to the MM Control##
round(c(full.2$IC.MFControl, quantile(full.2$boot[,18], c(0.025, 0.975))), digits=3)
#MF Inconsistency Costs#
round(c(full.2$IC.MF, quantile(full.2$boot[,9], c(0.025, 0.975))), digits=3)
#MM Inconsistency Costs#
round(c(full.2$IC.MM, quantile(full.2$boot[,6], c(0.025, 0.975))), digits=3)

##FM Belligerence Costs Relative to the MM Control##
round(c(full.2$BC.FMControl, quantile(full.2$boot[,23], c(0.025, 0.975))), digits=3)
#FM Belligerence Costs#
round(c(full.2$BC.FM, quantile(full.2$boot[,14], c(0.025, 0.975))), digits=3)
#MM Belligerence Costs#
round(c(full.2$BC.MM, quantile(full.2$boot[,5], c(0.025, 0.975))), digits=3)

##FF Belligerence Costs Relative to the MM Control##
round(c(full.2$BC.FFControl, quantile(full.2$boot[,20], c(0.025, 0.975))), digits=3)
#FF Belligerence Costs#
round(c(full.2$BC.FF, quantile(full.2$boot[,11], c(0.025, 0.975))), digits=3)
#MM Belligerence Costs#
round(c(full.2$BC.MM, quantile(full.2$boot[,5], c(0.025, 0.975))), digits=3)

##MF Belligerence Costs Relative to the MM Control##
round(c(full.2$BC.MFControl, quantile(full.2$boot[,17], c(0.025, 0.975))), digits=3)
#MF Belligerence Costs#
round(c(full.2$BC.MF, quantile(full.2$boot[,8], c(0.025, 0.975))), digits=3)
#MM Belligerence Costs#
round(c(full.2$BC.MM, quantile(full.2$boot[,5], c(0.025, 0.975))), digits=3)


###P-Values for Audience Costs Relative to the MM Control###
RNGkind(sample.kind="Rounding")
set.seed(43215)
B <- 2000 

bootTreat2 <- function(dat, label="Treatment"){
  bootResults <- matrix(NA, B)
  for (i in seq_len(B)){
    resample <- sample(1:nrow(dat),nrow(dat),replace=T)
    temp <- dat[resample,]
    A <- mean(temp$DisapprovalBinary[which(temp$StayOut==1)], na.rm=TRUE)
    B <- mean(temp$DisapprovalBinary[which(temp$NotEngage==1)], na.rm=TRUE)
    C <- mean(temp$DisapprovalBinary[which(temp$Engage==1)], na.rm=TRUE)
    bootResults[i] <- (B-A)
    drop(list())
  }
  return(list(model=label, boot=bootResults, ATE=mean(bootResults, na.rm=TRUE)))
}

MM <- bootTreat2(subset(TESS2, TESS2$FemaleUS==0 & TESS2$FemaleOpp==0))
FM <- bootTreat2(subset(TESS2, TESS2$FemaleUS==1 & TESS2$FemaleOpp==0))
MF <- bootTreat2(subset(TESS2, TESS2$FemaleUS==0 & TESS2$FemaleOpp==1))
FF <- bootTreat2(subset(TESS2, TESS2$FemaleUS==1 & TESS2$FemaleOpp==1))
Full <- bootTreat2(subset(TESS2))

p.calc <- function(mod, mod2, test){
  if(missing(test)){
    x <- 1-length(which(mod$boot < mod2$boot))/length(mod$boot)	
  }
  return(round(x,digits=4))
}

#FM P-Value#
p.calc(MM, FM)
#FF P-Value#
p.calc(MM, FF)
#MF P-Value#
p.calc(MM, MF)


###P-Values for Inconsistency Costs Relative to the MM Control###
RNGkind(sample.kind="Rounding")
set.seed(43215)
B <- 2000 

bootTreat2 <- function(dat, label="Treatment"){
  bootResults <- matrix(NA, B)
  for (i in seq_len(B)){
    resample <- sample(1:nrow(dat),nrow(dat),replace=T)
    temp <- dat[resample,]
    A <- mean(temp$DisapprovalBinary[which(temp$StayOut==1)], na.rm=TRUE)
    B <- mean(temp$DisapprovalBinary[which(temp$NotEngage==1)], na.rm=TRUE)
    C <- mean(temp$DisapprovalBinary[which(temp$Engage==1)], na.rm=TRUE)
    bootResults[i] <- (B-C)
    drop(list())
  }
  return(list(model=label, boot=bootResults, ATE=mean(bootResults, na.rm=TRUE)))
}

MM <- bootTreat2(subset(TESS2, TESS2$FemaleUS==0 & TESS2$FemaleOpp==0))
FM <- bootTreat2(subset(TESS2, TESS2$FemaleUS==1 & TESS2$FemaleOpp==0))
MF <- bootTreat2(subset(TESS2, TESS2$FemaleUS==0 & TESS2$FemaleOpp==1))
FF <- bootTreat2(subset(TESS2, TESS2$FemaleUS==1 & TESS2$FemaleOpp==1))
Full <- bootTreat2(subset(TESS2))

p.calc <- function(mod, mod2, test){
  if(missing(test)){
    x <- 1-length(which(mod$boot < mod2$boot))/length(mod$boot)	
  }
  return(round(x,digits=4))
}

#FM P-Value#
p.calc(MM, FM)
#FF P-Value#
p.calc(MM, FF)
#MF P-Value#
p.calc(MM, MF)

##P-Values for Belligerence Costs Relative to the MM Control##
RNGkind(sample.kind="Rounding")
set.seed(43215)
B <- 2000 

bootTreat2 <- function(dat, label="Treatment"){
  bootResults <- matrix(NA, B)
  for (i in seq_len(B)){
    resample <- sample(1:nrow(dat),nrow(dat),replace=T)
    temp <- dat[resample,]
    A <- mean(temp$DisapprovalBinary[which(temp$StayOut==1)], na.rm=TRUE)
    B <- mean(temp$DisapprovalBinary[which(temp$NotEngage==1)], na.rm=TRUE)
    C <- mean(temp$DisapprovalBinary[which(temp$Engage==1)], na.rm=TRUE)
    bootResults[i] <- (C-A)
    drop(list())
  }
  return(list(model=label, boot=bootResults, ATE=mean(bootResults, na.rm=TRUE)))
}

MM <- bootTreat2(subset(TESS2, TESS2$FemaleUS==0 & TESS2$FemaleOpp==0))
FM <- bootTreat2(subset(TESS2, TESS2$FemaleUS==1 & TESS2$FemaleOpp==0))
MF <- bootTreat2(subset(TESS2, TESS2$FemaleUS==0 & TESS2$FemaleOpp==1))
FF <- bootTreat2(subset(TESS2, TESS2$FemaleUS==1 & TESS2$FemaleOpp==1))
Full <- bootTreat2(subset(TESS2))

p.calc <- function(mod, mod2, test){
  if(missing(test)){
    x <- 1-length(which(mod$boot < mod2$boot))/length(mod$boot)	
  }
  return(round(x,digits=4))
}

#FM P-Value#
p.calc(FM, MM)
#FF P-Value#
p.calc(FF, MM)
#MF P-Value#
p.calc(MF, MM)



#####Internal Validity#####

##Excluding Respondents that Failed the Attention Check##
cor(TESS2$FemaleUS, TESS2$NonWhiteConfounding, use="complete.obs")
cor(TESS2$FemaleOpp, TESS2$RegimeConfounding, use="complete.obs")

##All Respondents##
cor(TESS$FemaleUS, TESS$NonWhiteConfounding, use="complete.obs")
cor(TESS$FemaleOpp, TESS$RegimeConfounding, use="complete.obs")



#####Table 4: Sentiment Analysis#####

##Convert from Wide to Long##
TESS_long <- gather(TESS, Number, word, Q4_1:Q4_4, factor_key=FALSE)

##Process Words##
TESS_long$word <- gsub("\x92", "'", TESS_long$word)
TESS_long$word <- gsub("\x93", "'", TESS_long$word)
TESS_long$word <- gsub("\x94", "'", TESS_long$word)
TESS_long$word[TESS_long$word=="D\xe9cisive"] <- "decisive"
TESS_long$word[TESS_long$word=="Na\xefve"] <- "naive"
TESS_long$word[TESS_long$word=="Paci\xeancia"] <- "patient"
TESS_long$word <- removePunctuation(TESS_long$word)
TESS_long$word <- removeNumbers(TESS_long$word)
TESS_long$word <- tolower(TESS_long$word)

##Read in BING Dictionary##
bing <- get_sentiments("bing")

###Merge BING Scores with TESS Data (Positive Sentiment= 1; Negative Sentiment = 0)##
TESS_long <- merge(TESS_long, bing, by=c("word"), all.x=TRUE)
TESS_long$bing_score <- NA 
TESS_long$bing_score[TESS_long$sentiment=="positive"] <- 1
TESS_long$bing_score[TESS_long$sentiment=="negative"] <- 0 
TESS_long$sentiment <- NULL

###Manually Code Missing BING (Note: Missing words are coded based on synonyms that are in the Bing dictionary)###
TESS_long$bing_score[TESS_long$word=="yikes"] <- 0 #Close to Disapprove
TESS_long$bing_score[TESS_long$word=="yielding"] <- 0 #Close to Surrender
TESS_long$bing_score[TESS_long$word=="wussy"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="wushu washy"] <- 0 #Close to Irresolute
TESS_long$bing_score[TESS_long$word=="wtf"] <- 0 #Close to F&*k
TESS_long$bing_score[TESS_long$word=="wreckless"] <- 0 #Close to Reckless
TESS_long$bing_score[TESS_long$word=="world leader"] <- 1 #Close to Authoritative
TESS_long$bing_score[TESS_long$word=="working"] <- 1 #Close to Durable
TESS_long$bing_score[TESS_long$word=="work hard"] <- 1 #Close to Durable
TESS_long$bing_score[TESS_long$word=="womanhater"] <- 0 #Close to Discriminatory
TESS_long$bing_score[TESS_long$word=="wits"] <- 1 #Close to Smart
TESS_long$bing_score[TESS_long$word=="without conviction"] <- 0 #Close to Irresolute
TESS_long$bing_score[TESS_long$word=="withholding"] <- 0 #Close to Aloof
TESS_long$bing_score[TESS_long$word=="withdrawn"] <- 0 #Close to Aloof
TESS_long$bing_score[TESS_long$word=="with her lack of action not because she is a female she said she would take action when in fact she did not"] <- 0 #Close to Forsake
TESS_long$bing_score[TESS_long$word=="wishywashy"] <- 0 #Close to Irresolute
TESS_long$bing_score[TESS_long$word=="wishy washy"] <- 0 #Close to Irresolute
TESS_long$bing_score[TESS_long$word=="wishwashy"] <- 0 #Close to Irresolute
TESS_long$bing_score[TESS_long$word=="wish washy"] <- 0 #Close to Irresolute
TESS_long$bing_score[TESS_long$word=="wimp"] <- 0 #Close to Wimpy
TESS_long$bing_score[TESS_long$word=="white supremacy"] <- 0 #Close to Racist
TESS_long$bing_score[TESS_long$word=="whimp"] <- 0 #Close to Wimpy
TESS_long$bing_score[TESS_long$word=="what the president says in the future will be questioned"] <- 0 #Close to Forsake
TESS_long$bing_score[TESS_long$word=="werid"] <- 0 #Close to Weird
TESS_long$bing_score[TESS_long$word=="went back on her word"] <- 0 #Close to Forsake
TESS_long$bing_score[TESS_long$word=="well advised"] <- 1 #Smart
TESS_long$bing_score[TESS_long$word=="weenie"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="week"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="weakminded"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="weakling"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="weakened"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="weak not a fighter need strong leadership"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="weak not a fighter need strong leadership"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="weak assuming its an ally"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="wavering"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="watchful"] <- 1 #Close to Protective
TESS_long$bing_score[TESS_long$word=="wants a better country for america"] <- 1 #Close to Patriotic
TESS_long$bing_score[TESS_long$word=="waivering"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="waiver"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="vision"] <- 1 #Close to Visionary
TESS_long$bing_score[TESS_long$word=="very unorganized"] <- 0 #Close to Disorganized
TESS_long$bing_score[TESS_long$word=="verbal abuse"] <- 0 #Close to Aggressive
TESS_long$bing_score[TESS_long$word=="values"] <- 1 #Close to Ethical
TESS_long$bing_score[TESS_long$word=="vacillating"] <- 0 #Close to Undecided
TESS_long$bing_score[TESS_long$word=="vacillant"] <- 0 #Close to Hesitant
TESS_long$bing_score[TESS_long$word=="uspresident"] <- 1 #Close to Authoritative
TESS_long$bing_score[TESS_long$word=="usa president"] <- 1 #Close to Authoritative
TESS_long$bing_score[TESS_long$word=="us president"] <- 1 #Close to Authoritative
TESS_long$bing_score[TESS_long$word=="untrusted"] <- 0 #Close to Untrustworthy
TESS_long$bing_score[TESS_long$word=="untrained"] <- 0 #Close to Unprepared
TESS_long$bing_score[TESS_long$word=="unthoughtful"] <- 0 #Close to Stupid
TESS_long$bing_score[TESS_long$word=="unthinking"] <- 0 #Close to Stupid
TESS_long$bing_score[TESS_long$word=="unsympathetic"] <- 0 #Close to Apathetic
TESS_long$bing_score[TESS_long$word=="unsuitable"] <- 0 #Close to Unacceptable
TESS_long$bing_score[TESS_long$word=="unstrategic"] <- 0 #Close to Stupid
TESS_long$bing_score[TESS_long$word=="unsmart"] <- 0 #Close to Stupid
TESS_long$bing_score[TESS_long$word=="unsincere"] <- 0 #Close to Dishonest
TESS_long$bing_score[TESS_long$word=="unserious"] <- 0 #Close to Fool
TESS_long$bing_score[TESS_long$word=="unrighteousness"] <- 0 #Close to Indecent
TESS_long$bing_score[TESS_long$word=="unresourceful"] <- 0 #Close to Stupid
TESS_long$bing_score[TESS_long$word=="unrelyable"] <- 0 #Close to Unreliable
TESS_long$bing_score[TESS_long$word=="unrelieabl"] <- 0 #Close to Unreliable
TESS_long$bing_score[TESS_long$word=="unprotective"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="unprofessional"] <- 0 #Close to Incompetent
TESS_long$bing_score[TESS_long$word=="unpresidential"] <- 0 #Close to Inadequate 
TESS_long$bing_score[TESS_long$word=="unpractical"] <- 0 #Close to Impractical
TESS_long$bing_score[TESS_long$word=="unpopalur"] <- 0 #Close to Unpopular
TESS_long$bing_score[TESS_long$word=="unpatriotic"] <- 0 #Close to Betray
TESS_long$bing_score[TESS_long$word=="unorganized"] <- 0 #Close to Disorganized
TESS_long$bing_score[TESS_long$word=="unobstrusive"] <- 0 #Close to Subdued
TESS_long$bing_score[TESS_long$word=="unneighborly"] <- 0 #Close to Unfriendly
TESS_long$bing_score[TESS_long$word=="unmotivated"] <- 0 #Close to Uncaring
TESS_long$bing_score[TESS_long$word=="unlearned"] <- 0 #Close to Stupid
TESS_long$bing_score[TESS_long$word=="unknowledgable"] <- 0 #Close to Stupid
TESS_long$bing_score[TESS_long$word=="uninvolved"] <- 0 #Close to Disinterested
TESS_long$bing_score[TESS_long$word=="unintimidated"] <- 1 #Close to Courageous
TESS_long$bing_score[TESS_long$word=="uninterested"] <- 0 #Close to Disinterested
TESS_long$bing_score[TESS_long$word=="unintelligent"] <- 0 #Close to Stupid
TESS_long$bing_score[TESS_long$word=="uninfotmed"] <- 0 #Close to Stupid
TESS_long$bing_score[TESS_long$word=="unimpressed"] <- 0 #Close to Disapprove
TESS_long$bing_score[TESS_long$word=="unimaginative"] <- 0 #Close to Dull
TESS_long$bing_score[TESS_long$word=="uniformed"] <- 0 #Close to Stupid
TESS_long$bing_score[TESS_long$word=="uniffective"] <- 0 #Close to Ineffective
TESS_long$bing_score[TESS_long$word=="unhinged"] <- 0 #Close to Crazy
TESS_long$bing_score[TESS_long$word=="unforcefu"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="unexperienced"] <- 0 #Close to Unqualified
TESS_long$bing_score[TESS_long$word=="unequipped"] <- 0 #Close to Unqualified
TESS_long$bing_score[TESS_long$word=="unempathetic"] <- 0 #Close to Apathetic
TESS_long$bing_score[TESS_long$word=="unelectable"] <- 0 #Close to Incompetent
TESS_long$bing_score[TESS_long$word=="uneducated"] <- 0 #Close to Stupid
TESS_long$bing_score[TESS_long$word=="undisciplined"] <- 0 #Close to Uncontrolled
TESS_long$bing_score[TESS_long$word=="undiplomatic"] <- 0 #Close to Aggressive
TESS_long$bing_score[TESS_long$word=="undeserving"] <- 0 #Close to Unworthy
TESS_long$bing_score[TESS_long$word=="underwhelming"] <- 0 #Close to Disappointing
TESS_long$bing_score[TESS_long$word=="understanding"] <- 1 #Close to Merciful 
TESS_long$bing_score[TESS_long$word=="undemocratic"] <- 0 #Close to Autocratic
TESS_long$bing_score[TESS_long$word=="undecisive"] <- 0 #Close to Indecisive
TESS_long$bing_score[TESS_long$word=="undeciesive"] <- 0 #Close to Indecisive
TESS_long$bing_score[TESS_long$word=="uncredible"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="unconfident"] <- 0 #Close to Non-Confidence
TESS_long$bing_score[TESS_long$word=="unconcerned"] <- 0 #Close to Uncaring
TESS_long$bing_score[TESS_long$word=="uncompassionate"] <- 0 #Close to Heartless
TESS_long$bing_score[TESS_long$word=="uncommitted"] <- 0 #Close to Uncaring
TESS_long$bing_score[TESS_long$word=="uncommited"] <- 0 #Close to Lazy
TESS_long$bing_score[TESS_long$word=="uncommital"] <- 0 #Close to Uncaring
TESS_long$bing_score[TESS_long$word=="uncomitted"] <- 0 #Close to Uncaring
TESS_long$bing_score[TESS_long$word=="uncareful"] <- 0 #Close to Careless
TESS_long$bing_score[TESS_long$word=="unbothered"] <- 0 #Close to Careless
TESS_long$bing_score[TESS_long$word=="unbelivable"] <- 0 #Close to Liar
TESS_long$bing_score[TESS_long$word=="unbecoming"] <- 0 #Close to Indecent
TESS_long$bing_score[TESS_long$word=="unaware"] <- 0 #Close to Stupid
TESS_long$bing_score[TESS_long$word=="unamerican"] <- 0 #Close to Betray
TESS_long$bing_score[TESS_long$word=="unaggressive"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="unaccountable"] <- 0 #Close to Irresponsible
TESS_long$bing_score[TESS_long$word=="un knowledgeable"] <- 0 #Close to Stupid
TESS_long$bing_score[TESS_long$word=="umdecisive"] <- 0 #Close to Indecisive
TESS_long$bing_score[TESS_long$word=="ugla"] <- 0 #Close to Ugly
TESS_long$bing_score[TESS_long$word=="ubworthy"] <- 0 #Close to Unworthy
TESS_long$bing_score[TESS_long$word=="two faced"] <- 0 #Close to Liar
TESS_long$bing_score[TESS_long$word=="turn back on her people"] <- 0 #Close to Betray
TESS_long$bing_score[TESS_long$word=="tunnelvision"] <- 0 #Close to Blind
TESS_long$bing_score[TESS_long$word=="trying"] <- 1 #Well-Intentioned
TESS_long$bing_score[TESS_long$word=="try"] <- 1 #Well-Intentioned
TESS_long$bing_score[TESS_long$word=="truthfull"] <- 1 #Close to Honest
TESS_long$bing_score[TESS_long$word=="truth"] <- 1 #Close to Honest
TESS_long$bing_score[TESS_long$word=="true"] <- 1 #Close to Honest
TESS_long$bing_score[TESS_long$word=="true to her word"] <- 1 #Close to Honest
TESS_long$bing_score[TESS_long$word=="tried"] <- 1 #Well-Intentioned
TESS_long$bing_score[TESS_long$word=="tried to help allies"] <- 1 #Well-Intentioned
TESS_long$bing_score[TESS_long$word=="trepidation"] <- 0 #Close to Worried
TESS_long$bing_score[TESS_long$word=="transparency"] <- 1 #Close to Transparent
TESS_long$bing_score[TESS_long$word=="tranquilo"] <- 1 #Close to Calm
TESS_long$bing_score[TESS_long$word=="too pensive"] <- 0 
TESS_long$bing_score[TESS_long$word=="too nice"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="too faced"] <- 0 #Close to Liar
TESS_long$bing_score[TESS_long$word=="too cautious"] <- 0 
TESS_long$bing_score[TESS_long$word=="too carefull"] <- 0 
TESS_long$bing_score[TESS_long$word=="tolerant"] <- 1 #Close to Easygoing
TESS_long$bing_score[TESS_long$word=="toddler"] <- 0 #Close to Unprepared
TESS_long$bing_score[TESS_long$word=="timud"] <- 0 #Close to Timid
TESS_long$bing_score[TESS_long$word=="threatning"] <- 0 #Close to Threaten
TESS_long$bing_score[TESS_long$word=="threatens"] <- 0 #Close to Threaten
TESS_long$bing_score[TESS_long$word=="thoughtfull"] <- 1 #Close to Thoughtful
TESS_long$bing_score[TESS_long$word=="thought less"] <- 0 #Close to Uncaring
TESS_long$bing_score[TESS_long$word=="thorough"] <- 1 #Close to Comprehensive
TESS_long$bing_score[TESS_long$word=="thinking"] <- 1 #Close to Smart
TESS_long$bing_score[TESS_long$word=="thinker"] <- 1 #Close to Smart
TESS_long$bing_score[TESS_long$word=="think"] <- 1 #Close to Smart
TESS_long$bing_score[TESS_long$word=="they can handle themselves"] <- 1 #Close to Autonomous
TESS_long$bing_score[TESS_long$word=="the president"] <- 1 #Close to Authoritative
TESS_long$bing_score[TESS_long$word=="the president has lost credibility with her citizens and any supporting allies"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="testostrone"] <- 0 #Close to Aggressive
TESS_long$bing_score[TESS_long$word=="terrorist"] <- 0 #Close to Terrorism
TESS_long$bing_score[TESS_long$word=="temperamental"] <- 0 #Close to Moody
TESS_long$bing_score[TESS_long$word=="teemplayer"] <- 1 #Close to Cooperative
TESS_long$bing_score[TESS_long$word=="target"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="talkitive"] <- 0 #Close to Chatterbox
TESS_long$bing_score[TESS_long$word=="talker"] <- 0 #Close to Chatterbox
TESS_long$bing_score[TESS_long$word=="talkative"] <- 0 #Close to Chatterbox
TESS_long$bing_score[TESS_long$word=="talk"] <- 0 #Close to Chatterbox
TESS_long$bing_score[TESS_long$word=="take care of us first"] <- 1 #Close to Loyal
TESS_long$bing_score[TESS_long$word=="tactical"] <- 1 #Close to Smart
TESS_long$bing_score[TESS_long$word=="tactful"] <- 1 #Close to Prudence
TESS_long$bing_score[TESS_long$word=="sympathetic"] <- 1 #Close to Compassionate
TESS_long$bing_score[TESS_long$word=="swag"] <- 1 #Close to Confident
TESS_long$bing_score[TESS_long$word=="surrendered"] <- 0 #Close to Surrender
TESS_long$bing_score[TESS_long$word=="sume what dumb"] <- 0 #Close to Dumb
TESS_long$bing_score[TESS_long$word=="stupid ileterate"] <- 0 #Close to Stupid
TESS_long$bing_score[TESS_long$word=="studied"] <- 1 #Close to Smart
TESS_long$bing_score[TESS_long$word=="stubbon"] <- 0 #Close to Stubborn
TESS_long$bing_score[TESS_long$word=="stubbbon"] <- 0 #Close to Stubborn
TESS_long$bing_score[TESS_long$word=="strongw"] <- 1 #Close to Strong
TESS_long$bing_score[TESS_long$word=="stronghold"] <- 1 #Close to Strong
TESS_long$bing_score[TESS_long$word=="strong woman"] <- 1 #Close to Strong
TESS_long$bing_score[TESS_long$word=="strong willed"] <- 1 #Close to Strong
TESS_long$bing_score[TESS_long$word=="strong minded"] <- 1 #Close to Strong
TESS_long$bing_score[TESS_long$word=="stressed"] <- 0 #Close to Stress
TESS_long$bing_score[TESS_long$word=="strength"] <- 1 #Close to Strong
TESS_long$bing_score[TESS_long$word=="stratigic"] <- 1 #Close to Smart
TESS_long$bing_score[TESS_long$word=="strategy"] <- 1 #Close to Smart
TESS_long$bing_score[TESS_long$word=="strategic"] <- 1 #Close to Smart
TESS_long$bing_score[TESS_long$word=="stong"] <- 1 #Close to Strong
TESS_long$bing_score[TESS_long$word=="stedfast"] <- 1 #Close to Steadfast
TESS_long$bing_score[TESS_long$word=="standsground"] <- 1 #Close to Strong
TESS_long$bing_score[TESS_long$word=="standofish"] <- 0 #Close to Aloof
TESS_long$bing_score[TESS_long$word=="standoffish"] <- 0 #Close to Aloof
TESS_long$bing_score[TESS_long$word=="stand offish"] <- 0 #Close to Aloof
TESS_long$bing_score[TESS_long$word=="stalwart"] <- 1 #Close to Strong
TESS_long$bing_score[TESS_long$word=="spoke his mind"] <- 1 #Close to Honest
TESS_long$bing_score[TESS_long$word=="spineless"] <- 0 #Close to Coward
TESS_long$bing_score[TESS_long$word=="speak the truth"] <- 1 #Close to Honest
TESS_long$bing_score[TESS_long$word=="sometimes racist"] <- 0 #Close to Racist
TESS_long$bing_score[TESS_long$word=="soft"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="sociopathic"] <- 0 #Close to Lunatic
TESS_long$bing_score[TESS_long$word=="slow response"] <- 0 #Close to Sluggish
TESS_long$bing_score[TESS_long$word=="slippery"] <- 0 #Close to Dishonest
TESS_long$bing_score[TESS_long$word=="skillless"] <- 0 #Close to Incapable
TESS_long$bing_score[TESS_long$word=="shrewd"] <- 1 #Close to Clever
TESS_long$bing_score[TESS_long$word=="showoff"] <- 0 #Close to Boastful
TESS_long$bing_score[TESS_long$word=="short sighted"] <- 0 #Close to Stupid
TESS_long$bing_score[TESS_long$word=="shitty"] <- 0 #Close to Shit
TESS_long$bing_score[TESS_long$word=="shitface"] <- 0 #Close to Shit
TESS_long$bing_score[TESS_long$word=="she meant what she was saying"] <- 1 #Close to Honest
TESS_long$bing_score[TESS_long$word=="sexist"] <- 0 #Close to Discriminatory
TESS_long$bing_score[TESS_long$word=="sexiest"] <- 1 #Close to Sexy
TESS_long$bing_score[TESS_long$word=="sensilbe"] <- 0 #Close to Sensible
TESS_long$bing_score[TESS_long$word=="selfserving"] <- 0 #Close to Selfish
TESS_long$bing_score[TESS_long$word=="selfserving"] <- 0 #Close to Selfish
TESS_long$bing_score[TESS_long$word=="selfprotective"] <- 0 #Close to Selfish
TESS_long$bing_score[TESS_long$word=="selfless"] <- 1 #Close to Unselfish
TESS_long$bing_score[TESS_long$word=="selffocused"] <- 0 #Close to Selfish
TESS_long$bing_score[TESS_long$word=="selfcentered"] <- 0 #Close to Selfish
TESS_long$bing_score[TESS_long$word=="selfassured"] <- 0 #Close to Selfish
TESS_long$bing_score[TESS_long$word=="selfabsorbed"] <- 0 #Close to Selfish
TESS_long$bing_score[TESS_long$word=="self interested"] <- 0 #Close to Selfish
TESS_long$bing_score[TESS_long$word=="self centered"] <- 0 #Close to Selfish
TESS_long$bing_score[TESS_long$word=="self absorbed"] <- 0 #Close to Selfish
TESS_long$bing_score[TESS_long$word=="security"] <- 1 #Close to Secure
TESS_long$bing_score[TESS_long$word=="secondguessing"] <- 0 #Close to Indecisive
TESS_long$bing_score[TESS_long$word=="saving"] <- 1 #Close to Safe
TESS_long$bing_score[TESS_long$word=="safety"] <- 1 #Close to Safe
TESS_long$bing_score[TESS_long$word=="rushed"] <- 0 #Close to Scramble
TESS_long$bing_score[TESS_long$word=="rush"] <- 0 #Close to Scramble
TESS_long$bing_score[TESS_long$word=="ruler"] <- 1 #Close to Authoritative
TESS_long$bing_score[TESS_long$word=="rudderless"] <- 0 #Close to Incapable
TESS_long$bing_score[TESS_long$word=="rigid"] <- 0 #Close to Inflexible
TESS_long$bing_score[TESS_long$word=="right move"] <- 1 #Close to Smart
TESS_long$bing_score[TESS_long$word=="retarted"] <- 0 #Close to Retard
TESS_long$bing_score[TESS_long$word=="results"] <- 1 #Close to Successful
TESS_long$bing_score[TESS_long$word=="resposible"] <- 1 #Close to Responsibly
TESS_long$bing_score[TESS_long$word=="responsible"] <- 1 #Close to Responsibly
TESS_long$bing_score[TESS_long$word=="responsibility"] <- 1 #Close to Responsibly
TESS_long$bing_score[TESS_long$word=="resonable"] <- 1 #Close to Reasonable
TESS_long$bing_score[TESS_long$word=="resolve"] <- 1 #Close to Steadfast
TESS_long$bing_score[TESS_long$word=="resilience"] <- 1 #Close to Resilient
TESS_long$bing_score[TESS_long$word=="resilent"] <- 1 #Close to Resilient
TESS_long$bing_score[TESS_long$word=="reserved"] <- 0 #Close to Reticent
TESS_long$bing_score[TESS_long$word=="renig"] <- 0 #Close to Forsake
TESS_long$bing_score[TESS_long$word=="renegger"] <- 0 #Close to Forsake
TESS_long$bing_score[TESS_long$word=="reneged"] <- 0 #Close to Forsake
TESS_long$bing_score[TESS_long$word=="renege"] <- 0 #Close to Forsake
TESS_long$bing_score[TESS_long$word=="removed"] <- 0 ##Close to Aloof
TESS_long$bing_score[TESS_long$word=="relatable"] <- 1 #Close to Likable
TESS_long$bing_score[TESS_long$word=="reason"] <- 1 #Close to Rational
TESS_long$bing_score[TESS_long$word=="real"] <- 1 #Close to Genuine
TESS_long$bing_score[TESS_long$word=="real leader"] <- 1 #Close to Genuine
TESS_long$bing_score[TESS_long$word=="reactive"] <- 0 #Close to Reactionary
TESS_long$bing_score[TESS_long$word=="ratioinal"] <- 1 #Close to Rational
TESS_long$bing_score[TESS_long$word=="raciest"] <- 0 #Close to Racist
TESS_long$bing_score[TESS_long$word=="pussy"] <- 0 #Close to Coward
TESS_long$bing_score[TESS_long$word=="pushy"] <- 0 #Close to Aggressive
TESS_long$bing_score[TESS_long$word=="pushover"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="push over"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="prying"] <- 0 #Close to Interferes
TESS_long$bing_score[TESS_long$word=="protector"] <- 1 #Close to Protect
TESS_long$bing_score[TESS_long$word=="protecting"] <- 1 #Close to Protect
TESS_long$bing_score[TESS_long$word=="protecting the homefront of usa"] <- 1 #Close to Protect
TESS_long$bing_score[TESS_long$word=="protecting our troops"] <- 1 #Close to Protect
TESS_long$bing_score[TESS_long$word=="protect his troops"] <- 1 #Close to Protect
TESS_long$bing_score[TESS_long$word=="promisekeeper"] <- 1 #Close to Honest
TESS_long$bing_score[TESS_long$word=="promise keeper"] <- 1 #Close to Honest
TESS_long$bing_score[TESS_long$word=="professional"] <- 1 #Close to Prepared
TESS_long$bing_score[TESS_long$word=="procrastinator"] <- 0 #Close to Procrastinate
TESS_long$bing_score[TESS_long$word=="procrastinating"] <- 0 #Close to Procrastinate
TESS_long$bing_score[TESS_long$word=="problem solver"] <- 1 #Close to Effective
TESS_long$bing_score[TESS_long$word=="proactive giving options"] <- 1 #Close to Proactive
TESS_long$bing_score[TESS_long$word=="primative"] <- 0 #Close to Primitive
TESS_long$bing_score[TESS_long$word=="prgmatic"] <- 1 #Close to Realistic
TESS_long$bing_score[TESS_long$word=="pressured"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="presidnet"] <- 1 #Close to Authoritative
TESS_long$bing_score[TESS_long$word=="presidential"] <- 1 #Close to Authoritative
TESS_long$bing_score[TESS_long$word=="presidental"] <- 1 #Close to Authoritative
TESS_long$bing_score[TESS_long$word=="president"] <- 1 #Close to Authoritative
TESS_long$bing_score[TESS_long$word=="president military"] <- 1 #Close to Authoritative
TESS_long$bing_score[TESS_long$word=="presdential"] <- 1 #Close to Authoritative
TESS_long$bing_score[TESS_long$word=="prepared"] <- 1 #Close to Qualified
TESS_long$bing_score[TESS_long$word=="preoccupied"] <- 0 #Close to Distract
TESS_long$bing_score[TESS_long$word=="premature"] <- 0 #Close to Rash
TESS_long$bing_score[TESS_long$word=="prejudiced"] <- 0 #Close to Prejudice
TESS_long$bing_score[TESS_long$word=="pragmatic"] <- 1 #Close to Realistic
TESS_long$bing_score[TESS_long$word=="practical"] <- 1 #Close to Realistic
TESS_long$bing_score[TESS_long$word=="ppoor leader"] <- 0 #Close to Incapable
TESS_long$bing_score[TESS_long$word=="powertrip"] <- 0 #Close to Egotistical or Greedy
TESS_long$bing_score[TESS_long$word=="powerful figure"] <- 1 #Close to Authoritative
TESS_long$bing_score[TESS_long$word=="power"] <- 1 #Close to Powerful
TESS_long$bing_score[TESS_long$word=="power hungry"] <- 0 #Close to Egotistical or Greedy
TESS_long$bing_score[TESS_long$word=="power happy"] <- 0 #Close to Egotistical or Greedy
TESS_long$bing_score[TESS_long$word=="power focused"] <- 0 #Close to Selfish
TESS_long$bing_score[TESS_long$word=="potus"] <- 1 #Close to Authoritative
TESS_long$bing_score[TESS_long$word=="poor planning"] <- 0 #Close to Unprepared
TESS_long$bing_score[TESS_long$word=="poor leader"] <- 0 #Close to Incapable
TESS_long$bing_score[TESS_long$word=="poor judgment"] <- 0 #Close to Misjudgment
TESS_long$bing_score[TESS_long$word=="poor judgement"] <- 0 #Close to Stupid
TESS_long$bing_score[TESS_long$word=="poor example of commander in chief"] <- 0 #Close to Incapable
TESS_long$bing_score[TESS_long$word=="poltroon"] <- 0 #Close to Coward
TESS_long$bing_score[TESS_long$word=="policy maker"] <- 1 #Close to Authoritative
TESS_long$bing_score[TESS_long$word=="planning"] <- 1 #Close to Ready
TESS_long$bing_score[TESS_long$word=="planned"] <- 1 #Close to Ready
TESS_long$bing_score[TESS_long$word=="placating"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="pig headed"] <- 0 #Close to Idiot
TESS_long$bing_score[TESS_long$word=="piece of shit"] <- 0 #Close to Shit
TESS_long$bing_score[TESS_long$word=="persistent"] <- 1 #Close to Resolute
TESS_long$bing_score[TESS_long$word=="persistant"] <- 1 #Close to Tenacious
TESS_long$bing_score[TESS_long$word=="perfessional"] <- 1 #Close to Qualified
TESS_long$bing_score[TESS_long$word=="peacemaker"] <- 1 #Close to Calm or Peaceful
TESS_long$bing_score[TESS_long$word=="peacekeeping"] <- 1 #Close to Calm or Peaceful
TESS_long$bing_score[TESS_long$word=="peacekeeper"] <- 1 #Close to Calm or Peaceful
TESS_long$bing_score[TESS_long$word=="peace oriented"] <- 1 #Close to Calm or Peaceful
TESS_long$bing_score[TESS_long$word=="peace maker"] <- 1 #Close to Calm or Peaceful
TESS_long$bing_score[TESS_long$word=="peacable"] <- 1 #Close to Calm or Peaceful
TESS_long$bing_score[TESS_long$word=="patriotism"] <- 1 #Close to Patriotic
TESS_long$bing_score[TESS_long$word=="passionte"] <- 1 #Close to Passionate
TESS_long$bing_score[TESS_long$word=="pasny"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="paper tiger"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="pansy"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="overthinking"] <- 0 #Close to Excessive
TESS_long$bing_score[TESS_long$word=="overstepping"] <- 0 #Close to Excessive
TESS_long$bing_score[TESS_long$word=="overseeing"] <- 1 #Close to Authoritative
TESS_long$bing_score[TESS_long$word=="overseeer"] <- 1 #Close to Authoritative
TESS_long$bing_score[TESS_long$word=="overreaching"] <- 0 #Close to Excessive
TESS_long$bing_score[TESS_long$word=="overmatched"] <- 0 #Close to Outshined
TESS_long$bing_score[TESS_long$word=="overconfident"] <- 0 #Close to Arrogant
TESS_long$bing_score[TESS_long$word=="overcommitting"] <- 0 #Close to Excessive
TESS_long$bing_score[TESS_long$word=="overcautious"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="over zealous"] <- 0 #Close to Overzealous
TESS_long$bing_score[TESS_long$word=="over reacting"] <- 0 #Close to Panic
TESS_long$bing_score[TESS_long$word=="over confident"] <- 0 #Close to Arrogant
TESS_long$bing_score[TESS_long$word=="over cautious"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="organzied"] <- 1 #Close to Orderly
TESS_long$bing_score[TESS_long$word=="organized"] <- 1 #Close to Orderly
TESS_long$bing_score[TESS_long$word=="openminded"] <- 1 #Close to Fair or Unbiased
TESS_long$bing_score[TESS_long$word=="open minded"] <- 1 #Close to Fair or Unbiased
TESS_long$bing_score[TESS_long$word=="open mind"] <- 1 #Close to Fair or Unbiased
TESS_long$bing_score[TESS_long$word=="one track mind"] <- 0
TESS_long$bing_score[TESS_long$word=="okay"] <- 1 #Close to Satisfactory
TESS_long$bing_score[TESS_long$word=="ok"] <- 1 #Close to Satisfactory
TESS_long$bing_score[TESS_long$word=="oddball"] <- 0 #Close to Weird
TESS_long$bing_score[TESS_long$word=="observing"] <- 1 #Close to Attentive
TESS_long$bing_score[TESS_long$word=="observant"] <- 1 #Close to Attentive
TESS_long$bing_score[TESS_long$word=="obsequious"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="objective"] <- 1 #Close to Unbiased
TESS_long$bing_score[TESS_long$word=="not worthy"] <- 0 #Close to Unworthy
TESS_long$bing_score[TESS_long$word=="not wise"] <- 0 #Close to Unworthy
TESS_long$bing_score[TESS_long$word=="not wise"] <- 0 #Close to Unwise
TESS_long$bing_score[TESS_long$word=="not trustworthy"] <- 0 #Close to Untrustworthy
TESS_long$bing_score[TESS_long$word=="not trust worth"] <- 0 #Close to Untrustworthy
TESS_long$bing_score[TESS_long$word=="not true to his own"] <- 1 #Close to Forsake
TESS_long$bing_score[TESS_long$word=="not strong"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="not smart"] <- 0 #Close to Stupid
TESS_long$bing_score[TESS_long$word=="not serious"] <- 0 #Close to Unqualified
TESS_long$bing_score[TESS_long$word=="not right"] <- 0 #Close to Wrong
TESS_long$bing_score[TESS_long$word=="not reliable"] <- 0 #Close to Unreliable
TESS_long$bing_score[TESS_long$word=="not ready"] <- 0 #Close to Unqualified
TESS_long$bing_score[TESS_long$word=="not qualify"] <- 0 #Close to Unqualified
TESS_long$bing_score[TESS_long$word=="not persistent"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="not minding his business"] <- 0 #Close to Interferes
TESS_long$bing_score[TESS_long$word=="not mindful"] <- 0 #Close to Stupid
TESS_long$bing_score[TESS_long$word=="not listening to others opinions"] <- 0 #Close to Egotistical
TESS_long$bing_score[TESS_long$word=="not intimidating"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="not honorable"] <- 0 #Close to Dishonest
TESS_long$bing_score[TESS_long$word=="not honest"] <- 0 #Close to Dishonest
TESS_long$bing_score[TESS_long$word=="not good"] <- 0 #Close to Bad
TESS_long$bing_score[TESS_long$word=="not following through"] <- 0 #Close to Forsake
TESS_long$bing_score[TESS_long$word=="not fit to be our president"] <- 0 #Close to Incapable
TESS_long$bing_score[TESS_long$word=="not firm"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="not fair"] <- 0 #Close to Biased
TESS_long$bing_score[TESS_long$word=="not enough"] <- 0 #Close to Insufficient
TESS_long$bing_score[TESS_long$word=="not doing his job the right way"] <- 0 #Close to Wrong
TESS_long$bing_score[TESS_long$word=="not dependable"] <- 0 #Close to Undependable
TESS_long$bing_score[TESS_long$word=="not credible"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="not confident"] <- 0 #Close to Non-Confidence
TESS_long$bing_score[TESS_long$word=="not concerned"] <- 0 #Close to Uncaring
TESS_long$bing_score[TESS_long$word=="not committed"] <- 0 #Close to Uncaring
TESS_long$bing_score[TESS_long$word=="not comitted"] <- 0 #Close to Uncaring
TESS_long$bing_score[TESS_long$word=="not believable"] <- 0 #Close to Liar
TESS_long$bing_score[TESS_long$word=="not american"] <- 0 #Close to Betray
TESS_long$bing_score[TESS_long$word=="not all there"] <- 0 #Close to Stupid
TESS_long$bing_score[TESS_long$word=="not active"] <- 0 #Close to Inaction
TESS_long$bing_score[TESS_long$word=="not acting correctly"] <- 0 #Close to Wrong
TESS_long$bing_score[TESS_long$word=="not able to see the consequences of inaction"] <- 0 #Close to Stupid
TESS_long$bing_score[TESS_long$word=="not a man of prayer"] <- 0 #Close to Heathen
TESS_long$bing_score[TESS_long$word=="not a man of his word"] <- 0 #Close to Forsake
TESS_long$bing_score[TESS_long$word=="not a leader"] <- 0 #Close to Incapable
TESS_long$bing_score[TESS_long$word=="not a fighter"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="nosy"] <- 0 #Close to Interferes
TESS_long$bing_score[TESS_long$word=="normal"] <- 1 
TESS_long$bing_score[TESS_long$word=="norcyciest"] <- 0 #Close to Egotistical
TESS_long$bing_score[TESS_long$word=="nonwarlike"] <- 1 #Close to Peaceful
TESS_long$bing_score[TESS_long$word=="nonviolent"] <- 1 #Close to Peaceful
TESS_long$bing_score[TESS_long$word=="nonunderstanding"] <- 0 #Close to Stupid
TESS_long$bing_score[TESS_long$word=="nontrustworthy"] <- 0 #Close to Untrustworthy
TESS_long$bing_score[TESS_long$word=="nonthinker"] <- 0 #Close to Stupid
TESS_long$bing_score[TESS_long$word=="nonsympathetic"] <- 0 #Close to Apathetic
TESS_long$bing_score[TESS_long$word=="nonstrategic"] <- 0 #Close to Stupid
TESS_long$bing_score[TESS_long$word=="nonstalwart"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="nonsavior"] <- 0 #Close to Incapable
TESS_long$bing_score[TESS_long$word=="nonresourceful"] <- 0 #Close to Stupid
TESS_long$bing_score[TESS_long$word=="nonresolute"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="nonpolitical"] <- 1 #Close to Impartial
TESS_long$bing_score[TESS_long$word=="nonpartisan"] <- 1 #Close to Impartial
TESS_long$bing_score[TESS_long$word=="nonnegotiator"] <- 0 #Close to Aggressive
TESS_long$bing_score[TESS_long$word=="nonmilitaristic"] <- 1 #Close to Peaceful
TESS_long$bing_score[TESS_long$word=="nonmilitant"] <- 1 #Close to Peaceful
TESS_long$bing_score[TESS_long$word=="nonmeddling"] <- 1 #Close to Courteous
TESS_long$bing_score[TESS_long$word=="nonleader"] <- 0 #Close to Incapable
TESS_long$bing_score[TESS_long$word=="nonknowledgeable"] <- 0 #Close to Stupid
TESS_long$bing_score[TESS_long$word=="nonintellectual"] <- 0 #Close to Stupid
TESS_long$bing_score[TESS_long$word=="nonimpulsive"] <- 1 #Close to Calm
TESS_long$bing_score[TESS_long$word=="nonhumanitarian"] <- 0 #Close to Inhumane
TESS_long$bing_score[TESS_long$word=="nonhesitant"] <- 1 #Close to Strong
TESS_long$bing_score[TESS_long$word=="nonhelpful"] <- 0 #Close to Unhelpful
TESS_long$bing_score[TESS_long$word=="none presidential"] <- 0 #Close to Incapable
TESS_long$bing_score[TESS_long$word=="none of my business to get into a foreign war"] <- 0 #Close to Interferes
TESS_long$bing_score[TESS_long$word=="none confrontatioal"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="nondiplomatic"] <- 0 #Close to Aggressive
TESS_long$bing_score[TESS_long$word=="nondecisive"] <- 0 #Close to Indecisive
TESS_long$bing_score[TESS_long$word=="noncredible"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="noncourageous"] <- 0 #Close to Coward
TESS_long$bing_score[TESS_long$word=="nonconfrontive"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="nonconfrontational"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="nonconfrontation"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="noncommitted"] <- 0 #Close to Evasive
TESS_long$bing_score[TESS_long$word=="noncommittal"] <- 0 #Close to Evasive
TESS_long$bing_score[TESS_long$word=="noncommitill"] <- 0 #Close to Evasive
TESS_long$bing_score[TESS_long$word=="noncommited"] <- 0 #Close to Evasive
TESS_long$bing_score[TESS_long$word=="noncommital"] <- 0 #Close to Evasive
TESS_long$bing_score[TESS_long$word=="noncomittal"] <- 0 #Close to Evasive
TESS_long$bing_score[TESS_long$word=="noncaring"] <- 0 #Close to Careless
TESS_long$bing_score[TESS_long$word=="nonbelligerent"] <- 1 #Close to Calm or Peaceful
TESS_long$bing_score[TESS_long$word=="nonacting"] <- 0 #Close to Inaction
TESS_long$bing_score[TESS_long$word=="non trustworthy"] <- 0 #Close to Unreliable
TESS_long$bing_score[TESS_long$word=="non sympathetic"] <- 0 #Close to Apathetic
TESS_long$bing_score[TESS_long$word=="non strategic"] <- 0 #Close to Stupid
TESS_long$bing_score[TESS_long$word=="non presidential"] <- 0 #Close to Incapable
TESS_long$bing_score[TESS_long$word=="non negotiator"] <- 0 #Close to Aggressive
TESS_long$bing_score[TESS_long$word=="non leader"] <- 0 #Close to Incapable
TESS_long$bing_score[TESS_long$word=="non diplomatic"] <- 0 #Close to Aggressive
TESS_long$bing_score[TESS_long$word=="non dependable"] <- 0 #Close to Unreliable
TESS_long$bing_score[TESS_long$word=="non confrontational"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="non confident"] <- 0 #Close to Non-Confidence
TESS_long$bing_score[TESS_long$word=="non compassion"] <- 0 #Close to Disdain or Indifferent
TESS_long$bing_score[TESS_long$word=="non committed"] <- 0 #Close to Lazy
TESS_long$bing_score[TESS_long$word=="non committal"] <- 0 #Close to Evasive
TESS_long$bing_score[TESS_long$word=="non appreciative"] <- 0 #Close to Ungrateful
TESS_long$bing_score[TESS_long$word=="non american"] <- 0 #Close to Betray
TESS_long$bing_score[TESS_long$word=="non agressive"] <- 0 #Close to Passive
TESS_long$bing_score[TESS_long$word=="no unity"] <- 0 #Close to Discord
TESS_long$bing_score[TESS_long$word=="no strength"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="no strategy"] <- 0 #Close to Stupid
TESS_long$bing_score[TESS_long$word=="no nonsense"] <- 1 #Close to Tough
TESS_long$bing_score[TESS_long$word=="no leadership"] <- 0 #Close to Incapable
TESS_long$bing_score[TESS_long$word=="no leader"] <- 0 #Close to Incapable
TESS_long$bing_score[TESS_long$word=="no knowledge of foreign policy"] <- 0 #Close to Stupid
TESS_long$bing_score[TESS_long$word=="no integrity"] <- 0 #Close to Dishonest
TESS_long$bing_score[TESS_long$word=="no help"] <- 0 #Close to Bad
TESS_long$bing_score[TESS_long$word=="no good"] <- 0 #Close to Bad
TESS_long$bing_score[TESS_long$word=="no followthru"] <- 0 #Close to Lack
TESS_long$bing_score[TESS_long$word=="no follow through"] <- 0 #Close to Lack
TESS_long$bing_score[TESS_long$word=="no follow thorough"] <- 0 #Close to Lack
TESS_long$bing_score[TESS_long$word=="no fear"] <- 1 #Close to Fearless
TESS_long$bing_score[TESS_long$word=="no experience"] <- 0 #Close to Inexperience
TESS_long$bing_score[TESS_long$word=="no empathy"] <- 0 #Close to Careless
TESS_long$bing_score[TESS_long$word=="no consequences for their actions"] <- 0 #Close to Irresponsible
TESS_long$bing_score[TESS_long$word=="no compromise"] <- 0 #Close to Hard-Line or Inflexible
TESS_long$bing_score[TESS_long$word=="no clue"] <- 0 #Close to Stupid
TESS_long$bing_score[TESS_long$word=="no character"] <- 0 #Close to Dishonest
TESS_long$bing_score[TESS_long$word=="no balls"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="no backbone"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="no back bone"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="no action"] <- 0 #Close to Inaction
TESS_long$bing_score[TESS_long$word=="nincompoop"] <- 0 #Close to Idiot
TESS_long$bing_score[TESS_long$word=="nihilist"] <- 0 #Close to Radical or Anarchist 
TESS_long$bing_score[TESS_long$word=="nieve"] <- 0 #Close to Naive
TESS_long$bing_score[TESS_long$word=="neville chamberlain"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="nervice"] <- 0 #Close to Nervous
TESS_long$bing_score[TESS_long$word=="neighborly"] <- 1 #Close to Friendly
TESS_long$bing_score[TESS_long$word=="negotiator"] <- 1 #Close to Conciliate 
TESS_long$bing_score[TESS_long$word=="negotiative"] <- 1 #Close to Conciliate 
TESS_long$bing_score[TESS_long$word=="negotiations"] <- 1 #Close to Conciliate 
TESS_long$bing_score[TESS_long$word=="negotiater"] <- 1 #Close to Conciliate 
TESS_long$bing_score[TESS_long$word=="negotiable"] <- 1 #Close to Conciliate 
TESS_long$bing_score[TESS_long$word=="neglecting"] <- 0 #Close to Neglect
TESS_long$bing_score[TESS_long$word=="negeliant"] <- 0 #Close to Careless
TESS_long$bing_score[TESS_long$word=="neg"] <- 0 #Close to Negative
TESS_long$bing_score[TESS_long$word=="needs to see in whole"] <- 0 #Close to Incapable
TESS_long$bing_score[TESS_long$word=="needs help"] <- 0 #Close to Incapable
TESS_long$bing_score[TESS_long$word=="need to put america first"] <- 0 #Close to Betray
TESS_long$bing_score[TESS_long$word=="need to be more careful"] <- 0 #Close to Careless
TESS_long$bing_score[TESS_long$word=="need to be consistent"] <- 0 #Close to Inconsistent
TESS_long$bing_score[TESS_long$word=="need stronger leadership"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="nationalistic"] <- 1 #Close to Patriotic
TESS_long$bing_score[TESS_long$word=="nationalist"] <- 1 #Close to Patriotic
TESS_long$bing_score[TESS_long$word=="narrowminded"] <- 0 #Close to Stupid
TESS_long$bing_score[TESS_long$word=="narrow"] <- 0 #Close to Stupid
TESS_long$bing_score[TESS_long$word=="narrow minded"] <- 0 #Close to Stupid
TESS_long$bing_score[TESS_long$word=="narcissistic"] <- 0 #Close to Egotistical
TESS_long$bing_score[TESS_long$word=="narcissistic nationalist"] <- 0 #Close to Egotistical
TESS_long$bing_score[TESS_long$word=="mouthy"] <- 0 #Close to Chatterbox
TESS_long$bing_score[TESS_long$word=="morels"] <- 1 #Close to Ethical
TESS_long$bing_score[TESS_long$word=="morals"] <- 1 #Close to Ethical
TESS_long$bing_score[TESS_long$word=="moral"] <- 1 #Close to Ethical
TESS_long$bing_score[TESS_long$word=="misrepresented"] <- 0 #Close to Mislead
TESS_long$bing_score[TESS_long$word=="misplaced"] <- 0 #Close to Wrong
TESS_long$bing_score[TESS_long$word=="misogynistic"] <- 0 #Close to Discriminate
TESS_long$bing_score[TESS_long$word=="misled"] <- 0 #Close to Mislead
TESS_long$bing_score[TESS_long$word=="misleadind"] <- 0 #Close to Mislead
TESS_long$bing_score[TESS_long$word=="misgovernment"] <- 0 #Close to Mismanage
TESS_long$bing_score[TESS_long$word=="minds his own business"] <- 1 #Close to Courteous 
TESS_long$bing_score[TESS_long$word=="minding own business"] <- 1 #Close to Courteous 
TESS_long$bing_score[TESS_long$word=="mindful"] <- 1 #Close to Thoughtful
TESS_long$bing_score[TESS_long$word=="mindful"] <- 1 #Close to Rational
TESS_long$bing_score[TESS_long$word=="militaristic"] <- 0 #Close to Aggressive
TESS_long$bing_score[TESS_long$word=="militant"] <- 0 #Close to Aggressive
TESS_long$bing_score[TESS_long$word=="mild mannered"] <- 1 #Close to Calm
TESS_long$bing_score[TESS_long$word=="methodical"] <- 1 #Close to Rational
TESS_long$bing_score[TESS_long$word=="mediator"] <- 1 #Close to Calm
TESS_long$bing_score[TESS_long$word=="meddling"] <- 0 #Close to Interferes
TESS_long$bing_score[TESS_long$word=="meddler"] <- 0 #Close to Interferes
TESS_long$bing_score[TESS_long$word=="measured"] <- 1 #Close to Calm
TESS_long$bing_score[TESS_long$word=="mean"] <- 0 #Close to Rude
TESS_long$bing_score[TESS_long$word=="maybe sexist"] <- 0 #Close to Bigot
TESS_long$bing_score[TESS_long$word=="manly"] <- 1 #Close to Tough
TESS_long$bing_score[TESS_long$word=="manipulated"] <- 0 #Close to Uncontrolled
TESS_long$bing_score[TESS_long$word=="manipulated"] <- 0 #Close to Lose
TESS_long$bing_score[TESS_long$word=="makes no sense"] <- 0 #Close to Incomprehensible
TESS_long$bing_score[TESS_long$word=="make america waste our money on a different country"] <- 0 #Close to Incompetent
TESS_long$bing_score[TESS_long$word=="low iq"] <- 0 #Close to Stupid
TESS_long$bing_score[TESS_long$word=="losing ground"] <- 0 #Close to Loser
TESS_long$bing_score[TESS_long$word=="looser"] <- 0 #Close to Loser
TESS_long$bing_score[TESS_long$word=="long term vision"] <- 1 #Close to Smart
TESS_long$bing_score[TESS_long$word=="logic"] <- 1 #Close to Logical
TESS_long$bing_score[TESS_long$word=="little risk"] <- 0 #Close to Cautious
TESS_long$bing_score[TESS_long$word=="lifesaving"] <- 1 #Close to Helpful
TESS_long$bing_score[TESS_long$word=="life less"] <- 0 #Close to Inaction
TESS_long$bing_score[TESS_long$word=="lie er"] <- 0 #Close to Liar
TESS_long$bing_score[TESS_long$word=="levelheaded"] <- 1 #Close to Calm
TESS_long$bing_score[TESS_long$word=="level headed"] <- 1 #Close to Calm
TESS_long$bing_score[TESS_long$word=="letting us be walked over"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="less talk more action"] <- 0 #Close to Inaction
TESS_long$bing_score[TESS_long$word=="legend"] <- 1 #Close to Awesome
TESS_long$bing_score[TESS_long$word=="learned"] <- 1 #Close to Smart
TESS_long$bing_score[TESS_long$word=="leadershipless"] <- 0 #Close to Incapable
TESS_long$bing_score[TESS_long$word=="leadership"] <- 1 #Close to Authoritative
TESS_long$bing_score[TESS_long$word=="leadership lacking"] <- 0 #Close to Incapable
TESS_long$bing_score[TESS_long$word=="leader"] <- 1 #Close to Authoritative
TESS_long$bing_score[TESS_long$word=="law order"] <- 1 #Close to Strong
TESS_long$bing_score[TESS_long$word=="lair"] <- 0 #Close to Liar
TESS_long$bing_score[TESS_long$word=="laidback"] <- 1 #Close to Calm
TESS_long$bing_score[TESS_long$word=="lacking in her duties"] <- 0 #Close to Incompetent
TESS_long$bing_score[TESS_long$word=="lacking follow through"] <- 0 #Close to Lack
TESS_long$bing_score[TESS_long$word=="lacking credibility"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="lack of leadership"] <- 0 #Close to Incapable
TESS_long$bing_score[TESS_long$word=="lack of follow throygh"] <- 0 #Close to Lack
TESS_long$bing_score[TESS_long$word=="lack of empathy"] <- 0 #Close to Indifference
TESS_long$bing_score[TESS_long$word=="lack of concern"] <- 0 #Close to Uncaring
TESS_long$bing_score[TESS_long$word=="lack of commitment"] <- 0 #Close to Uncaring
TESS_long$bing_score[TESS_long$word=="lack of command"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="lack of a real plan"] <- 0 #Close to Unprepared
TESS_long$bing_score[TESS_long$word=="lack integrity"] <- 0 #Close to Dishonest
TESS_long$bing_score[TESS_long$word=="lack experience"] <- 0 #Close to Inexperienced
TESS_long$bing_score[TESS_long$word=="knowlegeable"] <- 1 #Close to Knowledgeable
TESS_long$bing_score[TESS_long$word=="knowlege"] <- 1 #Close to Knowledgeable
TESS_long$bing_score[TESS_long$word=="knowlegable"] <- 1 #Close to Knowledgeable
TESS_long$bing_score[TESS_long$word=="knowledge"] <- 1 #Close to Knowledgeable
TESS_long$bing_score[TESS_long$word=="knowledgable"] <- 1 #Close to Knowledgeable
TESS_long$bing_score[TESS_long$word=="knowing"] <- 1 #Close to Knowledgeable
TESS_long$bing_score[TESS_long$word=="know"] <- 1 #Close to Knowledgeable
TESS_long$bing_score[TESS_long$word=="kind"] <- 1 #Close to Kindness
TESS_long$bing_score[TESS_long$word=="kept his word"] <- 1 #Close to Persevere
TESS_long$bing_score[TESS_long$word=="kept his promise"] <- 1 #Close to Persevere
TESS_long$bing_score[TESS_long$word=="keeper"] <- 1 #Close to Worthwhile
TESS_long$bing_score[TESS_long$word=="justified"] <- 1 #Close to Right or Correct
TESS_long$bing_score[TESS_long$word=="justice"] <- 1 #Close to Right or Correct
TESS_long$bing_score[TESS_long$word=="just"] <- 1 #Close to Right or Correct
TESS_long$bing_score[TESS_long$word=="jingoistic"] <- 0 #Close to Aggressive
TESS_long$bing_score[TESS_long$word=="jester"] <- 0 #Close to Fool
TESS_long$bing_score[TESS_long$word=="jackass"] <- 0 #Close to Ass
TESS_long$bing_score[TESS_long$word=="irresponsable"] <- 0 #Close to Irresponsible
TESS_long$bing_score[TESS_long$word=="irgonant"] <- 0 #Close to Ignorant
TESS_long$bing_score[TESS_long$word=="involved"] <- 1 #Close to Attentive
TESS_long$bing_score[TESS_long$word=="invest the money here in us and not outside us"] <- 0 #Close to Stupid
TESS_long$bing_score[TESS_long$word=="intolerant"] <- 0 #Close to Bigotry
TESS_long$bing_score[TESS_long$word=="intimidated"] <- 0 #Close to Intimidate
TESS_long$bing_score[TESS_long$word=="interferring"] <- 0 #Close to Meddle
TESS_long$bing_score[TESS_long$word=="interfering"] <- 0 #Close to Meddle
TESS_long$bing_score[TESS_long$word=="interferer"] <- 0 #Close to Meddle
TESS_long$bing_score[TESS_long$word=="interested"] <- 1 #Close to Focused
TESS_long$bing_score[TESS_long$word=="interested in usa"] <- 1 #Close to Patriotic
TESS_long$bing_score[TESS_long$word=="intellectual"] <- 1 #Close to Smart
TESS_long$bing_score[TESS_long$word=="integrity"] <- 1 #Close to Honorable
TESS_long$bing_score[TESS_long$word=="insupportive"] <- 0 #Close to Unsupportive
TESS_long$bing_score[TESS_long$word=="insensitve"] <- 0 #Close to Insensitive
TESS_long$bing_score[TESS_long$word=="innappropriate"] <- 0 #Close to Inappropriate
TESS_long$bing_score[TESS_long$word=="informed"] <- 1 #Close to Knowledgeable
TESS_long$bing_score[TESS_long$word=="inexperienced  to make the promise in the first place if not going to follow through"] <-  0 #Close to Unprepared
TESS_long$bing_score[TESS_long$word=="ineptit"] <- 0 #Close to Inept
TESS_long$bing_score[TESS_long$word=="ineptit"] <- 0 #Close to Inept
TESS_long$bing_score[TESS_long$word=="individual focus"] <- 0 #Close to Selfish
TESS_long$bing_score[TESS_long$word=="indicisive"] <- 0 #Close to Indecisive
TESS_long$bing_score[TESS_long$word=="indescive"] <- 0 #Close to Indecisive
TESS_long$bing_score[TESS_long$word=="independent"] <- 1 #Close to Autonomous
TESS_long$bing_score[TESS_long$word=="independant"] <- 1 #Close to Autonomous
TESS_long$bing_score[TESS_long$word=="indecisiveness"] <- 0 #Close to Indecisive
TESS_long$bing_score[TESS_long$word=="indecisiveness"] <- 0 #Close to Indecisive
TESS_long$bing_score[TESS_long$word=="indecesive"] <- 0 #Close to Indecisive
TESS_long$bing_score[TESS_long$word=="incompitent"] <- 0 #Close to Incompetent
TESS_long$bing_score[TESS_long$word=="incompenent"] <- 0 #Close to Incompetent
TESS_long$bing_score[TESS_long$word=="incompaint"] <- 0 #Close to Incompetent
TESS_long$bing_score[TESS_long$word=="inaffective"] <- 0 #Close to Ineffective
TESS_long$bing_score[TESS_long$word=="in power"] <- 1 #Close to Authoritative
TESS_long$bing_score[TESS_long$word=="in control"] <- 1 #Close to Authoritative
TESS_long$bing_score[TESS_long$word=="in charge"] <- 1 #Close to Authoritative
TESS_long$bing_score[TESS_long$word=="impressionable"] <- 0 #Close to Gullible
TESS_long$bing_score[TESS_long$word=="imperialistic"] <- 0 #Close to Aggressive 
TESS_long$bing_score[TESS_long$word=="imperial"] <- 0 #Close to Aggressive 
TESS_long$bing_score[TESS_long$word=="impeachment"] <- 0 #Close to Punis
TESS_long$bing_score[TESS_long$word=="imcompent"] <- 0 #Close to Incompetent
TESS_long$bing_score[TESS_long$word=="imbisole"] <- 0 #Close to Imbecile
TESS_long$bing_score[TESS_long$word=="illadvised"] <- 0 #Close to Stupid
TESS_long$bing_score[TESS_long$word=="ill informed"] <- 0 #Close to Stupid
TESS_long$bing_score[TESS_long$word=="ill advised"] <- 0 #Close to Stupid
TESS_long$bing_score[TESS_long$word=="ignorante"] <- 0 #Close to Ignorant
TESS_long$bing_score[TESS_long$word=="if she has to make a move with are military she will"] <- 1 #Close to Strong
TESS_long$bing_score[TESS_long$word=="humbled"] <- 0 #Close to Shame
TESS_long$bing_score[TESS_long$word=="humanity"] <- 1  #Close to Altruist
TESS_long$bing_score[TESS_long$word=="humanitarian"] <- 1  #Close to Altruist
TESS_long$bing_score[TESS_long$word=="hothead"] <- 0  #Close to Ill-Tempered
TESS_long$bing_score[TESS_long$word=="hotair"] <- 0  #Close to Boastful
TESS_long$bing_score[TESS_long$word=="hot head"] <- 0 #Close to Angry
TESS_long$bing_score[TESS_long$word=="hot air"] <- 0  #Close to Boastful
TESS_long$bing_score[TESS_long$word=="ho"] <- 0  #Close to S#@t
TESS_long$bing_score[TESS_long$word=="hitler"] <- 0 #Close to Bastard
TESS_long$bing_score[TESS_long$word=="hitler like"] <- 0 #Close to Bastard
TESS_long$bing_score[TESS_long$word=="his country should be his first priority"] <- 0  #Close to Betray
TESS_long$bing_score[TESS_long$word=="hipocrite"] <- 0 #Close to Hypocrite
TESS_long$bing_score[TESS_long$word=="hesitation"] <- 0  #Close to Hesitant
TESS_long$bing_score[TESS_long$word=="hesitatent"] <- 0  #Close to Hesitant
TESS_long$bing_score[TESS_long$word=="hesitatent"] <- 0  #Close to Hesitant
TESS_long$bing_score[TESS_long$word=="hesitated"] <- 0  #Close to Hesitant
TESS_long$bing_score[TESS_long$word=="hesitate"] <- 0  #Close to Hesitant
TESS_long$bing_score[TESS_long$word=="hesitant not following though"] <- 0  #Close to Hesitant
TESS_long$bing_score[TESS_long$word=="hesatent"] <- 0  #Close to Hesitant
TESS_long$bing_score[TESS_long$word=="hell nah"] <- 0  #Close to Denounce
TESS_long$bing_score[TESS_long$word=="heady"] <- 0  #Close to Rash
TESS_long$bing_score[TESS_long$word=="headstrong"] <- 1  #Close to Determined
TESS_long$bing_score[TESS_long$word=="head strong"] <- 1  #Close to Determined
TESS_long$bing_score[TESS_long$word=="he should be impreach"] <- 0 #Close to Punish
TESS_long$bing_score[TESS_long$word=="he dont care"] <- 0 #Close to Careless
TESS_long$bing_score[TESS_long$word=="he doesnt do his job"] <- 0 #Close to Incompetent
TESS_long$bing_score[TESS_long$word=="hardworking"] <- 0 #Close to Energetic
TESS_long$bing_score[TESS_long$word=="hard working"] <- 1 #Close to Passive
TESS_long$bing_score[TESS_long$word=="hard headedness"] <- 0 #Close to Stubborn
TESS_long$bing_score[TESS_long$word=="handsoff"] <- 0 #Close to Passive
TESS_long$bing_score[TESS_long$word=="hands off"] <- 0 #Close to Passive
TESS_long$bing_score[TESS_long$word=="half and half doing okay job but not strong enough"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="gung ho"] <- 1 #Close to Enthusiastic
TESS_long$bing_score[TESS_long$word=="grounded"] <- 1 
TESS_long$bing_score[TESS_long$word=="green"] <- 0 #Close to Unprepared
TESS_long$bing_score[TESS_long$word=="great leader"] <- 1 #Close to Great
TESS_long$bing_score[TESS_long$word=="grandstanding"] <- 0 #Close to Vain
TESS_long$bing_score[TESS_long$word=="grandiose"] <- 0 #Extravagant
TESS_long$bing_score[TESS_long$word=="good judgement"] <- 1 #Close to Smart
TESS_long$bing_score[TESS_long$word=="good job"] <- 1 #Close to Good
TESS_long$bing_score[TESS_long$word=="goner"] <- 0 #Close to Hopeless
TESS_long$bing_score[TESS_long$word=="godly"] <- 1 
TESS_long$bing_score[TESS_long$word=="god"] <- 1 
TESS_long$bing_score[TESS_long$word=="giving"] <- 1 #Close to Kind
TESS_long$bing_score[TESS_long$word=="get what he wants"] <- 1 #Close to Accomplish
TESS_long$bing_score[TESS_long$word=="gay"] <- 0 
TESS_long$bing_score[TESS_long$word=="fulfilling"] <- 1 #Close to Accomplish
TESS_long$bing_score[TESS_long$word=="fulfilling"] <- 1 #Close to Accomplish
TESS_long$bing_score[TESS_long$word=="fuck you"] <- 0 #Close to Fuck
TESS_long$bing_score[TESS_long$word=="frightened"] <- 0 #Close to Coward
TESS_long$bing_score[TESS_long$word=="friend"] <- 1 #Close to Friendly
TESS_long$bing_score[TESS_long$word=="frank"] <- 1 #Close to Honest
TESS_long$bing_score[TESS_long$word=="forwardthinking"] <- 1 #Close to Smart
TESS_long$bing_score[TESS_long$word=="forthright"] <- 1 #Close to Honest
TESS_long$bing_score[TESS_long$word=="forth coming"] <- 1 #Close to Honest
TESS_long$bing_score[TESS_long$word=="forgiving"] <- 1 #Close to Merciful 
TESS_long$bing_score[TESS_long$word=="foresightfree"] <- 0 #Close to Stupid
TESS_long$bing_score[TESS_long$word=="forced"] <- 0 #Close to Forceful
TESS_long$bing_score[TESS_long$word=="force"] <- 1 #Close to Strong
TESS_long$bing_score[TESS_long$word=="force full"] <- 0 #Close to Forceful
TESS_long$bing_score[TESS_long$word=="for weaker"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="for me it is hard to describe in one word however the president is weak"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="followthrough"] <- 1 #Close to Persevere
TESS_long$bing_score[TESS_long$word=="followsthrough"] <- 1 #Close to Persevere
TESS_long$bing_score[TESS_long$word=="follows thru"] <- 1 #Close to Persevere
TESS_long$bing_score[TESS_long$word=="follows through"] <- 1 #Close to Persevere
TESS_long$bing_score[TESS_long$word=="follower"] <- 0 #Close to Subordinate
TESS_long$bing_score[TESS_long$word=="followedthrough"] <- 1 #Close to Persevere
TESS_long$bing_score[TESS_long$word=="follow through"] <- 1 #Close to Persevere
TESS_long$bing_score[TESS_long$word=="folded"] <- 0 #Close to Surrender
TESS_long$bing_score[TESS_long$word=="focused"] <- 1 #Close to Attentive
TESS_long$bing_score[TESS_long$word=="focus"] <- 1 #Close to Attentive
TESS_long$bing_score[TESS_long$word=="flippant"] <- 0 #Close to Rude
TESS_long$bing_score[TESS_long$word=="flipflop"] <- 0 #Close to Inconsistent
TESS_long$bing_score[TESS_long$word=="flip flopper"] <- 0 #Close to Inconsistent
TESS_long$bing_score[TESS_long$word=="flip flop"] <- 0 #Close to Inconsistent
TESS_long$bing_score[TESS_long$word=="flacid"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="firm"] <- 1 #Close to Resolute
TESS_long$bing_score[TESS_long$word=="ficused"] <- 1 #Close to Attentive
TESS_long$bing_score[TESS_long$word=="ficused"] <- 1 #Close to Attentive
TESS_long$bing_score[TESS_long$word=="fast thinker"] <- 1 #Close to Smart
TESS_long$bing_score[TESS_long$word=="farsighted"] <- 1 #Close to Smart
TESS_long$bing_score[TESS_long$word=="faltering"] <- 0 #Close to Falter
TESS_long$bing_score[TESS_long$word=="false courage"] <- 0 #Close to Pretend
TESS_long$bing_score[TESS_long$word=="failed to act"] <- 0 #Close to Inaction
TESS_long$bing_score[TESS_long$word=="exposed"] <- 0 
TESS_long$bing_score[TESS_long$word=="expert"] <- 1 #Close to Qualified
TESS_long$bing_score[TESS_long$word=="expert"] <- 1 #Close to Qualified
TESS_long$bing_score[TESS_long$word=="experienced"] <- 1 #Close to Qualified
TESS_long$bing_score[TESS_long$word=="experience"] <- 1 #Close to Qualified
TESS_long$bing_score[TESS_long$word=="evaluating"] <- 1 #Close to Rational
TESS_long$bing_score[TESS_long$word=="evaluate"] <- 1 #Close to Evaluative
TESS_long$bing_score[TESS_long$word=="erroaant"] <- 0 #Close to Arrogant
TESS_long$bing_score[TESS_long$word=="enlightened"] <- 1 #Close to Smart
TESS_long$bing_score[TESS_long$word=="engaged"] <- 1 #Close to Commitment 
TESS_long$bing_score[TESS_long$word=="enabling"] <- 0 #Close to Capitulate 
TESS_long$bing_score[TESS_long$word=="enabler"] <- 0 #Close to Capitulate 
TESS_long$bing_score[TESS_long$word=="emptysuit"] <- 0 #Close to Barren
TESS_long$bing_score[TESS_long$word=="empty"] <- 0 #Close to Barren
TESS_long$bing_score[TESS_long$word=="empty threats"] <- 0 #Close to Forsake
TESS_long$bing_score[TESS_long$word=="empty threat"] <- 0 #Close to Forsake
TESS_long$bing_score[TESS_long$word=="empty promiser"] <- 0 #Close to Forsake
TESS_long$bing_score[TESS_long$word=="empowered"] <- 1 #Close to Authoritative
TESS_long$bing_score[TESS_long$word=="empathyfree"] <- 0 #Close to Disdain or Indifferent
TESS_long$bing_score[TESS_long$word=="empathetic"] <- 1 #Close to Compassionate
TESS_long$bing_score[TESS_long$word=="embarrassed"] <- 0 #Close to Embarrass
TESS_long$bing_score[TESS_long$word=="embarassment"] <- 0 #Close to Embarrass
TESS_long$bing_score[TESS_long$word=="egotistic"] <- 0 #Close to Boastful
TESS_long$bing_score[TESS_long$word=="egomaniacal"] <- 0 #Close to Boastful
TESS_long$bing_score[TESS_long$word=="egomaniac"] <- 0 #Close to Boastful
TESS_long$bing_score[TESS_long$word=="egoist"] <- 0 #Close to Boastful
TESS_long$bing_score[TESS_long$word=="ego"] <- 0 #Close to Boastful
TESS_long$bing_score[TESS_long$word=="easy going"] <- 1 #Close to Relaxed
TESS_long$bing_score[TESS_long$word=="dysfunctional"] <- 0 #Close to Broken
TESS_long$bing_score[TESS_long$word=="duplicitous"] <- 0 #Close to Deceit
TESS_long$bing_score[TESS_long$word=="dummy"] <- 0 #Close to Dumb
TESS_long$bing_score[TESS_long$word=="dumbest"] <- 0 #Close to Dumb
TESS_long$bing_score[TESS_long$word=="dumber"] <- 0 #Close to Dumb
TESS_long$bing_score[TESS_long$word=="dumbber"] <- 0 #Close to Dumb
TESS_long$bing_score[TESS_long$word=="dumbass"] <- 0 #Close to Dumb
TESS_long$bing_score[TESS_long$word=="dumb ass"] <- 0 #Close to Dumb
TESS_long$bing_score[TESS_long$word=="douche"] <- 0 #Close to Ass
TESS_long$bing_score[TESS_long$word=="dominating"] <- 1 #Close to Dominate
TESS_long$bing_score[TESS_long$word=="dominant"] <- 1 #Close to Dominate
TESS_long$bing_score[TESS_long$word=="doesnt care"] <- 0 #Close to Careless
TESS_long$bing_score[TESS_long$word=="doesnt care"] <- 0 #Close to Careless
TESS_long$bing_score[TESS_long$word=="does not think"] <- 0 #Close to Stupid
TESS_long$bing_score[TESS_long$word=="does not like hispanic"] <- 0 #Close to Racist
TESS_long$bing_score[TESS_long$word=="dodgy"] <- 0 #Close to Evasive
TESS_long$bing_score[TESS_long$word=="distracted"] <- 0 #Close to Distract
TESS_long$bing_score[TESS_long$word=="distant"] <- 0
TESS_long$bing_score[TESS_long$word=="disproved"] <- 0 #Close to Disapproved
TESS_long$bing_score[TESS_long$word=="disengaged"] <- 0 #Close to Aloof
TESS_long$bing_score[TESS_long$word=="discrimitory"] <- 0 #Close to Biased
TESS_long$bing_score[TESS_long$word=="discriminating"] <- 0 #Close to Discriminate
TESS_long$bing_score[TESS_long$word=="discreet"] <- 1 #Close to Considerate 
TESS_long$bing_score[TESS_long$word=="disconnected"] <- 0 
TESS_long$bing_score[TESS_long$word=="disciplined"] <- 1 #Close to Orderly
TESS_long$bing_score[TESS_long$word=="discerning"] <- 1 #Close to Smart
TESS_long$bing_score[TESS_long$word=="direct"] <- 1 #Close to Honest
TESS_long$bing_score[TESS_long$word=="diplomat"] <- 1 #Close to Conciliate
TESS_long$bing_score[TESS_long$word=="diplomacy"] <- 1 #Close to Diplomatic
TESS_long$bing_score[TESS_long$word=="didnt follow through on her promise"] <- 0 #Close to Forsake
TESS_long$bing_score[TESS_long$word=="did not take action"] <- 0 #Close to Inaction
TESS_long$bing_score[TESS_long$word=="dicisive"] <- 1 #Close to Decisive
TESS_long$bing_score[TESS_long$word=="diaspointing"] <- 0 #Close to Disappointing
TESS_long$bing_score[TESS_long$word=="diapointing"] <- 0 #Close to Disappointing
TESS_long$bing_score[TESS_long$word=="dialogue"] <- 1 #Close to Clear
TESS_long$bing_score[TESS_long$word=="dialog"] <- 1 #Close to Clear
TESS_long$bing_score[TESS_long$word=="devoted"] <- 1 #Close to Steadfast
TESS_long$bing_score[TESS_long$word=="detetmined"] <- 1 #Close to Steadfast
TESS_long$bing_score[TESS_long$word=="detetermined"] <- 1 #Close to Steadfast
TESS_long$bing_score[TESS_long$word=="determined"] <- 1 #Close to Steadfast
TESS_long$bing_score[TESS_long$word=="determination"] <- 1 #Close to Steadfast
TESS_long$bing_score[TESS_long$word=="detached"] <- 0 #Close to Aloof
TESS_long$bing_score[TESS_long$word=="dependant"] <- 0 #Close to Vulnerable
TESS_long$bing_score[TESS_long$word=="demented"] <- 0 #Close to Insane
TESS_long$bing_score[TESS_long$word=="demanding"] <- 0 #Close to Onerous
TESS_long$bing_score[TESS_long$word=="deliberative"] <- 1 #Close to Rational
TESS_long$bing_score[TESS_long$word=="deliberate"] <- 1 #Close to Rational
TESS_long$bing_score[TESS_long$word=="delegating"] <- 1 #Close to Entrust
TESS_long$bing_score[TESS_long$word=="definitive"] <- 1 #Close to Decisive
TESS_long$bing_score[TESS_long$word=="definite"] <- 1 #Close to Decisive
TESS_long$bing_score[TESS_long$word=="defenseless"] <- 0 #Close to Helpless
TESS_long$bing_score[TESS_long$word=="defeatist"] <- 0 #Close to Weak or Pessimist
TESS_long$bing_score[TESS_long$word=="deescalating conflict"] <- 1 #Close to Peaceful
TESS_long$bing_score[TESS_long$word=="decissev"] <- 1 #Close to Decisive
TESS_long$bing_score[TESS_long$word=="decisions"] <- 1 #Close to Decisive
TESS_long$bing_score[TESS_long$word=="decisionmaker"] <- 1 #Close to Authoritative
TESS_long$bing_score[TESS_long$word=="decision"] <- 1 #Close to Decisive
TESS_long$bing_score[TESS_long$word=="decision maker"] <- 1 #Close to Authoritative
TESS_long$bing_score[TESS_long$word=="deciding"] <- 1 #Close to Decisive
TESS_long$bing_score[TESS_long$word=="decidesive"] <- 1 #Close to Decisive
TESS_long$bing_score[TESS_long$word=="decider"] <- 1 #Close to Decisive
TESS_long$bing_score[TESS_long$word=="decidedly"] <- 1 #Close to Decisive
TESS_long$bing_score[TESS_long$word=="decided"] <- 1 #Close to Decisive
TESS_long$bing_score[TESS_long$word=="deceived"] <- 0 #Close to Tricked
TESS_long$bing_score[TESS_long$word=="debilitated"] <- 0 #Close to Infirm
TESS_long$bing_score[TESS_long$word=="ddumb"] <- 0 #Close to Dumb
TESS_long$bing_score[TESS_long$word=="dddumb"] <- 0 #Close to Dumb
TESS_long$bing_score[TESS_long$word=="cunning"] <- 1 #Close to Smart
TESS_long$bing_score[TESS_long$word=="cuidadoso"] <- 0 #Close to Careful
TESS_long$bing_score[TESS_long$word=="crybaby"] <- 0 #Close to Whiny
TESS_long$bing_score[TESS_long$word=="cowardice"] <- 0 #Close to Coward
TESS_long$bing_score[TESS_long$word=="cow"] <- 0 
TESS_long$bing_score[TESS_long$word=="couragous"] <- 1 #Close to Brave
TESS_long$bing_score[TESS_long$word=="courage lacking"] <- 0 #Close to Coward
TESS_long$bing_score[TESS_long$word=="cooperation"] <- 1 #Close to Cooperative
TESS_long$bing_score[TESS_long$word=="coolheaded"] <- 1 #Close to Calm
TESS_long$bing_score[TESS_long$word=="conviction"] <- 1 #Close to Passionate
TESS_long$bing_score[TESS_long$word=="controlling"] <- 0 #Close to Overbearing
TESS_long$bing_score[TESS_long$word=="controlled"] <- 1 #Close to Authoritative
TESS_long$bing_score[TESS_long$word=="control"] <- 1 #Close to Authoritative
TESS_long$bing_score[TESS_long$word=="contributor"] <- 1 #Close to Contribution
TESS_long$bing_score[TESS_long$word=="contrary"] <- 0 #Close to Inconsistent
TESS_long$bing_score[TESS_long$word=="contemplative"] <- 1 #Close to Rational
TESS_long$bing_score[TESS_long$word=="consistant"] <- 1 #Close to Consistent
TESS_long$bing_score[TESS_long$word=="considering"] <- 1 #Close to Rational
TESS_long$bing_score[TESS_long$word=="considerate of his own country"] <- 1 #Close to Patriotic
TESS_long$bing_score[TESS_long$word=="conscience"] <- 1 #Close to Ethical
TESS_long$bing_score[TESS_long$word=="conplacent"] <- 0 #Close to Complacent
TESS_long$bing_score[TESS_long$word=="confidant"] <- 1 #Close to Confident
TESS_long$bing_score[TESS_long$word=="conciencious"] <- 0 #Close to Thoughtgul
TESS_long$bing_score[TESS_long$word=="comprehension needed"] <- 0 #Close to Stupid
TESS_long$bing_score[TESS_long$word=="comprehending"] <- 1 #Close to Smart
TESS_long$bing_score[TESS_long$word=="comprehending"] <- 1 #Close to Smart
TESS_long$bing_score[TESS_long$word=="compossed"] <- 1 #Close to Confident
TESS_long$bing_score[TESS_long$word=="composed"] <- 1 #Close to Confident
TESS_long$bing_score[TESS_long$word=="competent"] <- 1 #Close to Competent
TESS_long$bing_score[TESS_long$word=="competant"] <- 1 #Close to Competent
TESS_long$bing_score[TESS_long$word=="compassionless"] <- 0 #Close to Heartless
TESS_long$bing_score[TESS_long$word=="compasionate"] <- 1 #Close to Compassionate
TESS_long$bing_score[TESS_long$word=="communicative"] <- 1 #Close to Clear
TESS_long$bing_score[TESS_long$word=="communicate"] <- 1 #Close to Clear
TESS_long$bing_score[TESS_long$word=="common sense"] <- 1 #Close to Smart
TESS_long$bing_score[TESS_long$word=="committed"] <- 1 #Close to Commitment
TESS_long$bing_score[TESS_long$word=="commited"] <- 1 #Close to Commitment
TESS_long$bing_score[TESS_long$word=="commanding"] <- 1 #Close to Authoritative
TESS_long$bing_score[TESS_long$word=="commanderinchief"] <- 1 #Close to Authoritative
TESS_long$bing_score[TESS_long$word=="commander"] <- 1 #Close to Authoritative
TESS_long$bing_score[TESS_long$word=="collected"] <- 1 #Close to Calm
TESS_long$bing_score[TESS_long$word=="collabrate with world"] <- 1 #Close to Cooperative
TESS_long$bing_score[TESS_long$word=="collaborative"] <- 1 #Close to Cooperative
TESS_long$bing_score[TESS_long$word=="coldhearted"] <- 0 #Close to Heartless
TESS_long$bing_score[TESS_long$word=="cold hearted"] <- 0 #Close to Heartless
TESS_long$bing_score[TESS_long$word=="clown"] <- 0 #Close to Fool
TESS_long$bing_score[TESS_long$word=="closeminded"] <- 0 #Close to Blind
TESS_long$bing_score[TESS_long$word=="close minded"] <- 0 #Close to Blind
TESS_long$bing_score[TESS_long$word=="clear headed"] <- 1 #Close to Smart
TESS_long$bing_score[TESS_long$word=="classless"] <- 0 #Close to Crude
TESS_long$bing_score[TESS_long$word=="cinfident"] <- 1 #Close to Confident
TESS_long$bing_score[TESS_long$word=="chief"] <- 1 #Close to Authoritative
TESS_long$bing_score[TESS_long$word=="chickenhawk"] <- 0 #Close to Hypocritical
TESS_long$bing_score[TESS_long$word=="chicken"] <- 0 #Close to Coward
TESS_long$bing_score[TESS_long$word=="chicken shit"] <- 0 #Close to Worthless
TESS_long$bing_score[TESS_long$word=="chauvinist"] <- 0 #Close to Bigot
TESS_long$bing_score[TESS_long$word=="cavalier"] <- 0 #Close to Disdain
TESS_long$bing_score[TESS_long$word=="cautious"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="cautios"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="cautionous"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="caution"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="carring"] <- 1 #Close to Loving
TESS_long$bing_score[TESS_long$word=="carries out threats"] <- 1 #Close to Decisive
TESS_long$bing_score[TESS_long$word=="caring"] <- 1 #Close to Attentive or Loving 
TESS_long$bing_score[TESS_long$word=="cares"] <- 1 #Close to Attentive or Loving 
TESS_long$bing_score[TESS_long$word=="cares about own country"] <- 1 #Close to Loyal
TESS_long$bing_score[TESS_long$word=="careing"] <- 1 #Close to Attentive or Loving 
TESS_long$bing_score[TESS_long$word=="carefull"] <- 1 #Close to Attentive
TESS_long$bing_score[TESS_long$word=="careful"] <- 1 #Close to Attentive
TESS_long$bing_score[TESS_long$word=="careful in making decisions"] <- 1 #Close to Attentive
TESS_long$bing_score[TESS_long$word=="care"] <- 1 #Close to Responsibly or Loving 
TESS_long$bing_score[TESS_long$word=="cant trust"] <- 0 #Close to Untrustworthy
TESS_long$bing_score[TESS_long$word=="candid"] <- 1 #Close to Honest
TESS_long$bing_score[TESS_long$word=="cagey"] <- 0 #Close to Wary
TESS_long$bing_score[TESS_long$word=="butt"] <- 0 #Close to Ass 
TESS_long$bing_score[TESS_long$word=="butt"] <- 0 #Close to Ass
TESS_long$bing_score[TESS_long$word=="bumbling"] <- 0 #Close to Idiot
TESS_long$bing_score[TESS_long$word=="bullied"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="bull"] <- 0 #Close to Bullshit
TESS_long$bing_score[TESS_long$word=="bs"] <- - #Close to Bullshit
TESS_long$bing_score[TESS_long$word=="bozo"] <- 0 #Close to Idiot
TESS_long$bing_score[TESS_long$word=="boss"] <- 1 #Close to Authoritative
TESS_long$bing_score[TESS_long$word=="bold"] <- 1 #Close to Brave
TESS_long$bing_score[TESS_long$word=="boasting"] <- 0 #Close to Bragger
TESS_long$bing_score[TESS_long$word=="boastfully"] <- 0 #Close to Bragger
TESS_long$bing_score[TESS_long$word=="blustery"] <- 0 #Close to Bragger
TESS_long$bing_score[TESS_long$word=="blustering"] <- 0 #Close to Bragger
TESS_long$bing_score[TESS_long$word=="blusterer"] <- 0 #Close to Bragger
TESS_long$bing_score[TESS_long$word=="bluster"] <- 0 #Close to Bragger
TESS_long$bing_score[TESS_long$word=="blowheart"] <- 0 #Close to Boastful
TESS_long$bing_score[TESS_long$word=="blowhard"] <- 0 #Close to Boastful
TESS_long$bing_score[TESS_long$word=="blame others"] <- 0 #Close to Irresponsible
TESS_long$bing_score[TESS_long$word=="bipartisan"] <- 1 #Close to Conciliate 
TESS_long$bing_score[TESS_long$word=="bigot"] <- 0  #Close to Racist
TESS_long$bing_score[TESS_long$word=="biggot"] <- 0 #Close to Biased 
TESS_long$bing_score[TESS_long$word=="bigamist"] <- 0 #Close to Cheater
TESS_long$bing_score[TESS_long$word=="big talker"] <- 0 #Close to Boastful
TESS_long$bing_score[TESS_long$word=="big mouth"] <- 0 #Close to Boastful
TESS_long$bing_score[TESS_long$word=="biast"] <- 0 #Close to Biased
TESS_long$bing_score[TESS_long$word=="best president"] <- 1 #Close to Awesome
TESS_long$bing_score[TESS_long$word=="bending"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="bend"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="Believes US must solve everything while enemies such as N Korea and China stay out of the fray and aren<92>t approaching one trillion $ debt"] <- 0 #Close to Stupid
TESS_long$bing_score[TESS_long$word=="basura"] <- 0 #Close to Trash
TESS_long$bing_score[TESS_long$word=="balls"] <- 1 #Close to Bold
TESS_long$bing_score[TESS_long$word=="bad president"] <- 0 #Close to Inadequate
TESS_long$bing_score[TESS_long$word=="bad leader"] <- 0 #Close to Inadequate
TESS_long$bing_score[TESS_long$word=="bad decision"] <- 0 #Close to Mistake
TESS_long$bing_score[TESS_long$word=="bad communicator"] <- 0 #Close to Inarticulate
TESS_long$bing_score[TESS_long$word=="bad ally"] <- 0 #Close to Forsake
TESS_long$bing_score[TESS_long$word=="bad alliance"] <- 0 #Close to Disloyal
TESS_long$bing_score[TESS_long$word=="backtrack"] <- 0 #Close to Retreat
TESS_long$bing_score[TESS_long$word=="backstabbing"] <- 0 #Close to Betray
TESS_long$bing_score[TESS_long$word=="backpeddler"] <- 0 #Close to Retreat
TESS_long$bing_score[TESS_long$word=="backpedaling"] <- 0 #Close to Retreat
TESS_long$bing_score[TESS_long$word=="backing"] <- 0 #Close to Retreat
TESS_long$bing_score[TESS_long$word=="backing off"] <- 0 #Close to Retreat
TESS_long$bing_score[TESS_long$word=="backed down"] <- 0 #Close to Retreat
TESS_long$bing_score[TESS_long$word=="backdown"] <- 0 #Close to Retreat
TESS_long$bing_score[TESS_long$word=="back tracker"] <- 0 #Close to Retreat
TESS_long$bing_score[TESS_long$word=="baby"] <- 0 #Close to Unprepared
TESS_long$bing_score[TESS_long$word=="aware"] <- 1 #Close to Attentive
TESS_long$bing_score[TESS_long$word=="aware of the situation"] <- 1 #Close to Attentive
TESS_long$bing_score[TESS_long$word=="avoids"] <- 0 #Close to Evasive
TESS_long$bing_score[TESS_long$word=="avoidant"] <- 0 #Close to Evasive
TESS_long$bing_score[TESS_long$word=="avoidance"] <- 0 #Close to Evasive
TESS_long$bing_score[TESS_long$word=="authority"] <- 1 #Close to Authoritative
TESS_long$bing_score[TESS_long$word=="atypical"] <- 0 #Close to Abnormal
TESS_long$bing_score[TESS_long$word=="atheist"] <- 0 #Close to Heathen
TESS_long$bing_score[TESS_long$word=="assist"] <- 1 #Close to Helpful
TESS_long$bing_score[TESS_long$word=="assholw"] <- 0 #Close to Ass
TESS_long$bing_score[TESS_long$word=="asshole"] <- 0 #Close to Ass
TESS_long$bing_score[TESS_long$word=="ass"] <- 0 #Close to Ass
TESS_long$bing_score[TESS_long$word=="arrougant"] <- 0 #Close to Arrogant
TESS_long$bing_score[TESS_long$word=="arguementive"] <- 0 #Close to Contentious
TESS_long$bing_score[TESS_long$word=="approvimg"] <- 1 #Close to Approve
TESS_long$bing_score[TESS_long$word=="appeasing"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="appeasement"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="appears weak"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="apeaser"] <- 0 #Close to Weak
TESS_long$bing_score[TESS_long$word=="antichrist"] <- 0 #Close to Bastard
TESS_long$bing_score[TESS_long$word=="another war"] <- 0 #Close to Insanity
TESS_long$bing_score[TESS_long$word=="analyzing"] <- 1 #Close to Rational
TESS_long$bing_score[TESS_long$word=="analyze"] <- 1 #Close to Rational
TESS_long$bing_score[TESS_long$word=="analytical"] <- 1 #Close to Rational
TESS_long$bing_score[TESS_long$word=="americans"] <- 1 #Close to Patriotic
TESS_long$bing_score[TESS_long$word=="american"] <- 1 #Close to Patriotic
TESS_long$bing_score[TESS_long$word=="america"] <- 1 #Close to Patriotic
TESS_long$bing_score[TESS_long$word=="america first"] <- 1 #Close to Patriotic
TESS_long$bing_score[TESS_long$word=="amateurish"] <- 0 #Close to Unprepared
TESS_long$bing_score[TESS_long$word=="amateur"] <- 0 #Close to Unprepared
TESS_long$bing_score[TESS_long$word=="alright"] <- 1 #Close to Sufficient or Adequate
TESS_long$bing_score[TESS_long$word=="ally"] <- 0 #Close to Friendly
TESS_long$bing_score[TESS_long$word=="all talk"] <- 0 #Close to Inaction
TESS_long$bing_score[TESS_long$word=="alert"] <- 1 #Close to Attentive
TESS_long$bing_score[TESS_long$word=="airhead"] <- 0 #Close to Idiot 
TESS_long$bing_score[TESS_long$word=="agressive"] <- 0 #Close to Aggressive 
TESS_long$bing_score[TESS_long$word=="afraid of conflict"] <- 0 #Close to Afraid
TESS_long$bing_score[TESS_long$word=="affraid"] <- 0 #Close to Afraid
TESS_long$bing_score[TESS_long$word=="admiral"] <- 1 #Close to Authoritative
TESS_long$bing_score[TESS_long$word=="adept"] <- 1 #Close to Adroit
TESS_long$bing_score[TESS_long$word=="active"] <- 1 #Close to Proactive and Opposite of Inactive 
TESS_long$bing_score[TESS_long$word=="achieved"] <- 1 #Close to Achievable 
TESS_long$bing_score[TESS_long$word=="accomidating"] <- 1 #Close to Accommodative 
TESS_long$bing_score[TESS_long$word=="able"] <- 1 #Close to Capable
TESS_long$bing_score[TESS_long$word=="a little intrusive"] <- 0 #Intrusive
TESS_long$bing_score[TESS_long$word=="a hole"] <- 0 #Asshole

##Reverse Code Bing (1 = Negative; 0 = Positive)##
TESS_long$bing_score <- ifelse(TESS_long$bing_score==1, 0, 1)

##Go from Long Back to Wide##
TESS_wide <- subset(TESS_long, select=c(CaseId, Number, bing_score))
TESS_wide <- reshape(TESS_wide, direction="wide", idvar="CaseId", timevar="Number")                   
TESS_wide <- merge(TESS_wide, TESS, by=c("CaseId"), all=TRUE)

##Calculate Means for Each Subject##
TESS_wide$bing_score <- rowMeans(subset(TESS_wide, select=c(bing_score.Q4_1, bing_score.Q4_2, bing_score.Q4_3, bing_score.Q4_4)), na.rm=TRUE)

##Bootstrapped Difference in Means##
TESS_wide_attn <- subset(TESS_wide, AttentionCheck>=2)

RNGkind(sample.kind="Rounding")
set.seed(43215)
B <- 2000 

bootTreat2 <- function(dat, label="Treatment"){
  bootResults <- matrix(NA, nrow=B, ncol=24)
  for (i in seq_len(B)){
    resample <- sample(1:nrow(dat),nrow(dat),replace=T)
    temp <- dat[resample,]
    A <- mean(temp$bing_score[which(temp$StayOut==1)], na.rm=TRUE)
    B <- mean(temp$bing_score[which(temp$NotEngage==1)], na.rm=TRUE)
    C <- mean(temp$bing_score[which(temp$Engage==1)], na.rm=TRUE)
    D <- mean(temp$bing_score[which(temp$StayOut==1 & temp$FemaleUS==0 & temp$FemaleOpp==0)], na.rm=TRUE)
    E <- mean(temp$bing_score[which(temp$NotEngage==1 & temp$FemaleUS==0 & temp$FemaleOpp==0)], na.rm=TRUE)
    G <- mean(temp$bing_score[which(temp$Engage==1 & temp$FemaleUS==0 & temp$FemaleOpp==0)], na.rm=TRUE)
    H <- mean(temp$bing_score[which(temp$StayOut==1 & temp$FemaleUS==0 & temp$FemaleOpp==1)], na.rm=TRUE)
    I <- mean(temp$bing_score[which(temp$NotEngage==1 & temp$FemaleUS==0 & temp$FemaleOpp==1)], na.rm=TRUE)
    J <- mean(temp$bing_score[which(temp$Engage==1 & temp$FemaleUS==0 & temp$FemaleOpp==1)], na.rm=TRUE)   
    K <- mean(temp$bing_score[which(temp$StayOut==1 & temp$FemaleUS==1 & temp$FemaleOpp==1)], na.rm=TRUE)
    L <- mean(temp$bing_score[which(temp$NotEngage==1 & temp$FemaleUS==1 & temp$FemaleOpp==1)], na.rm=TRUE)
    M <- mean(temp$bing_score[which(temp$Engage==1 & temp$FemaleUS==1 & temp$FemaleOpp==1)], na.rm=TRUE)      
    N <- mean(temp$bing_score[which(temp$StayOut==1 & temp$FemaleUS==1 & temp$FemaleOpp==0)], na.rm=TRUE)
    O <- mean(temp$bing_score[which(temp$NotEngage==1 & temp$FemaleUS==1 & temp$FemaleOpp==0)], na.rm=TRUE)
    P <- mean(temp$bing_score[which(temp$Engage==1 & temp$FemaleUS==1 & temp$FemaleOpp==0)], na.rm=TRUE)     
    bootResults[i,1] <- (B-A)
    bootResults[i,2] <- (C-A)
    bootResults[i,3] <- (B-C)  
    bootResults[i,4] <- (E-D)
    bootResults[i,5] <- (G-D)
    bootResults[i,6] <- (E-G)  
    bootResults[i,7] <- (I-H)
    bootResults[i,8] <- (J-H)
    bootResults[i,9] <- (I-J)  
    bootResults[i,10] <- (L-K)
    bootResults[i,11] <- (M-K)
    bootResults[i,12] <- (L-M)  
    bootResults[i,13] <- (O-N)
    bootResults[i,14] <- (P-N)
    bootResults[i,15] <- (O-P)  
    bootResults[i,16] <- (I-H) - (E-D) 
    bootResults[i,17] <- (J-H) - (G-D) 
    bootResults[i,18] <- (I-J) - (E-G) 
    bootResults[i,19] <- (L-K) - (E-D) 
    bootResults[i,20] <- (M-K) - (G-D) 
    bootResults[i,21] <- (L-M) - (E-G) 
    bootResults[i,22] <- (O-N) - (E-D) 
    bootResults[i,23] <- (P-N) - (G-D) 
    bootResults[i,24] <- (O-P) - (E-G) 
    drop(list())
  }
  return(list(model=label, boot=bootResults, AC.Full=mean(bootResults[,1], na.rm=TRUE), 
              BC.Full=mean(bootResults[,2], na.rm=TRUE), IC.Full=mean(bootResults[,3], na.rm=TRUE), 
              AC.MM=mean(bootResults[,4], na.rm=TRUE), BC.MM=mean(bootResults[,5], na.rm=TRUE), 
              IC.MM=mean(bootResults[,6], na.rm=TRUE), AC.MF=mean(bootResults[,7], na.rm=TRUE), 
              BC.MF=mean(bootResults[,8], na.rm=TRUE), IC.MF=mean(bootResults[,9], na.rm=TRUE),
              AC.FF=mean(bootResults[,10], na.rm=TRUE), BC.FF=mean(bootResults[,11], na.rm=TRUE), 
              IC.FF=mean(bootResults[,12], na.rm=TRUE), AC.FM=mean(bootResults[,13], na.rm=TRUE), 
              BC.FM=mean(bootResults[,14], na.rm=TRUE), IC.FM=mean(bootResults[,15], na.rm=TRUE),
              AC.MFControl=mean(bootResults[,16], na.rm=TRUE), BC.MFControl=mean(bootResults[,17], na.rm=TRUE),
              IC.MFControl=mean(bootResults[,18], na.rm=TRUE), AC.FFControl=mean(bootResults[,19], na.rm=TRUE),
              BC.FFControl=mean(bootResults[,20], na.rm=TRUE), IC.FFControl=mean(bootResults[,21], na.rm=TRUE),
              AC.FMControl=mean(bootResults[,22], na.rm=TRUE), BC.FMControl=mean(bootResults[,23], na.rm=TRUE),
              IC.FMControl=mean(bootResults[,24], na.rm=TRUE)))
}

full.2 <- bootTreat2(TESS_wide_attn)

##FM Audience Costs Relative to the MM Control##
round(c(full.2$AC.FMControl, quantile(full.2$boot[,22], c(0.025, 0.975))), digits=3)
#FM Audience Costs#
round(c(full.2$AC.FM, quantile(full.2$boot[,13], c(0.025, 0.975))), digits=3)
#MM Audience Costs#
round(c(full.2$AC.MM, quantile(full.2$boot[,4], c(0.025, 0.975))), digits=3)

##FF Audience Costs Relative to the MM Control##
round(c(full.2$AC.FFControl, quantile(full.2$boot[,19], c(0.025, 0.975))), digits=3)
#FF Audience Costs#
round(c(full.2$AC.FF, quantile(full.2$boot[,10], c(0.025, 0.975))), digits=3)
#MM Audience Costs#
round(c(full.2$AC.MM, quantile(full.2$boot[,4], c(0.025, 0.975))), digits=3)

##MF Audience Costs Relative to the MM Control##
round(c(full.2$AC.MFControl, quantile(full.2$boot[,16], c(0.025, 0.975))), digits=3)
#MF Audience Costs#
round(c(full.2$AC.MF, quantile(full.2$boot[,7], c(0.025, 0.975))), digits=3)
#MM Audience Costs#
round(c(full.2$AC.MM, quantile(full.2$boot[,4], c(0.025, 0.975))), digits=3)

##FM Inconsistency Costs Relative to the MM Control##
round(c(full.2$IC.FMControl, quantile(full.2$boot[,24], c(0.025, 0.975))), digits=3)
#FM Inconsistency Costs#
round(c(full.2$IC.FM, quantile(full.2$boot[,15], c(0.025, 0.975))), digits=3)
#MM Inconsistency Costs#
round(c(full.2$IC.MM, quantile(full.2$boot[,6], c(0.025, 0.975))), digits=3)

##FF Inconsistency Costs Relative to the MM Control##
round(c(full.2$IC.FFControl, quantile(full.2$boot[,21], c(0.025, 0.975))), digits=3)
#FF Inconsistency Costs#
round(c(full.2$IC.FF, quantile(full.2$boot[,12], c(0.025, 0.975))), digits=3)
#MM Inconsistency Costs#
round(c(full.2$IC.MM, quantile(full.2$boot[,6], c(0.025, 0.975))), digits=3)

##MF Inconsistency Costs Relative to the MM Control##
round(c(full.2$IC.MFControl, quantile(full.2$boot[,18], c(0.025, 0.975))), digits=3)
#MF Inconsistency Costs#
round(c(full.2$IC.MF, quantile(full.2$boot[,9], c(0.025, 0.975))), digits=3)
#MM Inconsistency Costs#
round(c(full.2$IC.MM, quantile(full.2$boot[,6], c(0.025, 0.975))), digits=3)

##FM Belligerence Costs Relative to the MM Control##
round(c(full.2$BC.FMControl, quantile(full.2$boot[,23], c(0.025, 0.975))), digits=3)
#FM Belligerence Costs#
round(c(full.2$BC.FM, quantile(full.2$boot[,14], c(0.025, 0.975))), digits=3)
#MM Belligerence Costs#
round(c(full.2$BC.MM, quantile(full.2$boot[,5], c(0.025, 0.975))), digits=3)

##FF Belligerence Costs Relative to the MM Control##
round(c(full.2$BC.FFControl, quantile(full.2$boot[,20], c(0.025, 0.975))), digits=3)
#FF Belligerence Costs#
round(c(full.2$BC.FF, quantile(full.2$boot[,11], c(0.025, 0.975))), digits=3)
#MM Belligerence Costs#
round(c(full.2$BC.MM, quantile(full.2$boot[,5], c(0.025, 0.975))), digits=3)

##MF Belligerence Costs Relative to the MM Control##
round(c(full.2$BC.MFControl, quantile(full.2$boot[,17], c(0.025, 0.975))), digits=3)
#MF Belligerence Costs#
round(c(full.2$BC.MF, quantile(full.2$boot[,8], c(0.025, 0.975))), digits=3)
#MM Belligerence Costs#
round(c(full.2$BC.MM, quantile(full.2$boot[,5], c(0.025, 0.975))), digits=3)


##P-Values for Audience Costs Relative to the MM Control##
RNGkind(sample.kind="Rounding")
set.seed(43215)
B <- 2000 

bootTreat2 <- function(dat, label="Treatment"){
  bootResults <- matrix(NA, B)
  for (i in seq_len(B)){
    resample <- sample(1:nrow(dat),nrow(dat),replace=T)
    temp <- dat[resample,]
    A <- mean(temp$bing_score[which(temp$StayOut==1)], na.rm=TRUE)
    B <- mean(temp$bing_score[which(temp$NotEngage==1)], na.rm=TRUE)
    C <- mean(temp$bing_score[which(temp$Engage==1)], na.rm=TRUE)
    bootResults[i] <- (B-A)
    drop(list())
  }
  return(list(model=label, boot=bootResults, ATE=mean(bootResults, na.rm=TRUE)))
}

MM <- bootTreat2(subset(TESS_wide_attn, TESS_wide_attn$FemaleUS==0 & TESS_wide_attn$FemaleOpp==0))
FM <- bootTreat2(subset(TESS_wide_attn, TESS_wide_attn$FemaleUS==1 & TESS_wide_attn$FemaleOpp==0))
MF <- bootTreat2(subset(TESS_wide_attn, TESS_wide_attn$FemaleUS==0 & TESS_wide_attn$FemaleOpp==1))
FF <- bootTreat2(subset(TESS_wide_attn, TESS_wide_attn$FemaleUS==1 & TESS_wide_attn$FemaleOpp==1))
Full <- bootTreat2(subset(TESS_wide_attn))

p.calc <- function(mod, mod2, test){
  if(missing(test)){
    x <- 1-length(which(mod$boot < mod2$boot))/length(mod$boot)	
  }
  return(round(x,digits=4))
}

#FM P-Value#
p.calc(MM, FM)
#FF P-Value#
p.calc(MM, FF)
#MF P-Value#
p.calc(MM, MF)

##P-Values for Inconsistency Costs Relative to the MM Control##
RNGkind(sample.kind="Rounding")
set.seed(43215)
B <- 2000 

bootTreat2 <- function(dat, label="Treatment"){
  bootResults <- matrix(NA, B)
  for (i in seq_len(B)){
    resample <- sample(1:nrow(dat),nrow(dat),replace=T)
    temp <- dat[resample,]
    A <- mean(temp$bing_score[which(temp$StayOut==1)], na.rm=TRUE)
    B <- mean(temp$bing_score[which(temp$NotEngage==1)], na.rm=TRUE)
    C <- mean(temp$bing_score[which(temp$Engage==1)], na.rm=TRUE)
    bootResults[i] <- (B-C)
    drop(list())
  }
  return(list(model=label, boot=bootResults, ATE=mean(bootResults, na.rm=TRUE)))
}

MM <- bootTreat2(subset(TESS_wide_attn, TESS_wide_attn$FemaleUS==0 & TESS_wide_attn$FemaleOpp==0))
FM <- bootTreat2(subset(TESS_wide_attn, TESS_wide_attn$FemaleUS==1 & TESS_wide_attn$FemaleOpp==0))
MF <- bootTreat2(subset(TESS_wide_attn, TESS_wide_attn$FemaleUS==0 & TESS_wide_attn$FemaleOpp==1))
FF <- bootTreat2(subset(TESS_wide_attn, TESS_wide_attn$FemaleUS==1 & TESS_wide_attn$FemaleOpp==1))
Full <- bootTreat2(subset(TESS_wide_attn))

p.calc <- function(mod, mod2, test){
  if(missing(test)){
    x <- 1-length(which(mod$boot < mod2$boot))/length(mod$boot)	
  }
  return(round(x,digits=4))
}

#FM P-Value#
p.calc(MM, FM)
#FF P-Value#
p.calc(MM, FF)
#MF P-Value#
p.calc(MM, MF)

##P-Values for Belligerence Costs Relative to the MM Control##
RNGkind(sample.kind="Rounding")
set.seed(43215)
B <- 2000 

bootTreat2 <- function(dat, label="Treatment"){
  bootResults <- matrix(NA, B)
  for (i in seq_len(B)){
    resample <- sample(1:nrow(dat),nrow(dat),replace=T)
    temp <- dat[resample,]
    A <- mean(temp$bing_score[which(temp$StayOut==1)], na.rm=TRUE)
    B <- mean(temp$bing_score[which(temp$NotEngage==1)], na.rm=TRUE)
    C <- mean(temp$bing_score[which(temp$Engage==1)], na.rm=TRUE)
    bootResults[i] <- (C-A)
    drop(list())
  }
  return(list(model=label, boot=bootResults, ATE=mean(bootResults, na.rm=TRUE)))
}

MM <- bootTreat2(subset(TESS_wide_attn, TESS_wide_attn$FemaleUS==0 & TESS_wide_attn$FemaleOpp==0))
FM <- bootTreat2(subset(TESS_wide_attn, TESS_wide_attn$FemaleUS==1 & TESS_wide_attn$FemaleOpp==0))
MF <- bootTreat2(subset(TESS_wide_attn, TESS_wide_attn$FemaleUS==0 & TESS_wide_attn$FemaleOpp==1))
FF <- bootTreat2(subset(TESS_wide_attn, TESS_wide_attn$FemaleUS==1 & TESS_wide_attn$FemaleOpp==1))
Full <- bootTreat2(subset(TESS_wide_attn))

p.calc <- function(mod, mod2, test){
  if(missing(test)){
    x <- 1-length(which(mod$boot < mod2$boot))/length(mod$boot)	
  }
  return(round(x,digits=4))
}

#FM P-Value#
p.calc(FM, MM)
#FF P-Value#
p.calc(FF, MM)
#MF P-Value#
p.calc(MF, MM)


